array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'splfileinfo.getpathname.php', 1 => 'SplFileInfo::getPathname', 2 => 'Gets the path to the file', ), 'up' => array ( 0 => 'class.splfileinfo.php', 1 => 'SplFileInfo', ), 'prev' => array ( 0 => 'splfileinfo.getpathinfo.php', 1 => 'SplFileInfo::getPathInfo', ), 'next' => array ( 0 => 'splfileinfo.getperms.php', 1 => 'SplFileInfo::getPerms', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/spl/splfileinfo/getpathname.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

SplFileInfo::getPathname

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

SplFileInfo::getPathnameGets the path to the file

说明

public SplFileInfo::getPathname(): string

Returns the path to the file.

参数

此函数没有参数。

返回值

The path to the file.

示例

示例 #1 SplFileInfo::getPathname() example

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

以上示例的输出类似于:

string(12) "/usr/bin/php"

参见