首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

DirectoryIterator::getPathname

(PHP 5, PHP 7)

DirectoryIterator :: getPathname - 返回当前DirectoryIterator项目的路径和文件名

Description

代码语言:javascript
复制
public string DirectoryIterator::getPathname ( void )

获取当前文件的路径和文件名。

Parameters

该功能没有参数。

Return Values

返回当前文件的路径和文件名。目录没有尾随斜线。

Examples

Example #1 DirectoryIterator::getPathname() example

代码语言:javascript
复制
<?php
$iterator = new DirectoryIterator(dirname(__FILE__));
foreach ($iterator as $fileinfo) {
    echo $fileinfo->getPathname() . "\n";
}
?>

上面的例子会输出类似于:

代码语言:javascript
复制
/home/examples/.
/home/examples/..
/home/examples/apple.jpg
/home/examples/banana.jpg
/home/examples/getpathname.php
/home/examples/pear.jpg

← DirectoryIterator::getPath

DirectoryIterator::getPerms →

代码语言:txt
复制
 © 1997–2017 The PHP Documentation Group

根据知识共享署名许可证v3.0或更高版本授权。

扫码关注腾讯云开发者

领取腾讯云代金券