PHP 8.3.4 Released!

SplFileInfo::getPath

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

SplFileInfo::getPathGets the path without filename

Açıklama

public SplFileInfo::getPath(): string

Returns the path to the file, omitting the filename and any trailing slash.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Returns the path to the file.

Örnekler

Örnek 1 SplFileInfo::getPath() example

<?php
$info
= new SplFileInfo('/usr/bin/php');
var_dump($info->getPath());


$info = new SplFileInfo('/usr/');
var_dump($info->getPath());?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

string(8) "/usr/bin"
string(4) "/usr"

Ayrıca Bakınız

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top