update : 2015.11.03
php.shukuma.com

검색:
 
 
Gets an SplFileInfo object for the path

SplFileInfo::getPathInfo

(PHP 5 >= 5.1.2)

SplFileInfo::getPathInfoGets an SplFileInfo object for the path

설명

public SplFileInfo SplFileInfo::getPathInfo ([ string $class_name ] )

Gets an SplFileInfo object for the parent of the current file.

인수

class_name

Name of an SplFileInfo derived class to use.

반환값

Returns an SplFileInfo object for the parent path of the file.

예제

Example #1 SplFileInfo::getPathInfo() example

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

위 예제의 출력 예시:

string(8) "/usr/bin"

참고