DirectoryIterator::getPath

(PHP 5, PHP 7)
Get path of current Iterator item without filename
public string DirectoryIterator::getPath ( void )

Get the path to the current DirectoryIterator item.

Returns:

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

Examples:
DirectoryIterator::getPath() example
<?php
$iterator = new DirectoryIterator(dirname(__FILE__));
echo $iterator->getPath();
?>

The above example will output something similar to:

/home/examples/public_html
See also:

DirectoryIterator::getBasename() -

DirectoryIterator::getFilename() -

DirectoryIterator::getPathname() -

pathinfo() -

doc_php
2016-02-24 16:19:48
Comments
Leave a Comment

Please login to continue.