(PHP 5 >= 5.1.2, PHP 7)
Gets an SplFileInfo object for the path
public SplFileInfo SplFileInfo::getPathInfo ([ string $class_name ] )
Gets an SplFileInfo object for the parent of the current file.
Parameters:
class_name
Name of an SplFileInfo derived class to use.
Returns:
Returns an SplFileInfo object for the parent path of the file.
Examples:
SplFileInfo::getPathInfo() example
1 2 3 4 5 | <?php $info = new SplFileInfo( '/usr/bin/php' ); $parent_info = $info ->getPathInfo(); var_dump( $parent_info ->getRealPath()); ?> |
The above example will output something similar to:
string(8) "/usr/bin"
See also:
Please login to continue.