downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SplFileInfo::getPathname> <SplFileInfo::getPath
[edit] Last updated: Fri, 25 May 2012

view this page in

SplFileInfo::getPathInfo

(PHP 5 >= 5.1.2)

SplFileInfo::getPathInfoパスの SplFileInfo オブジェクトを取得する

説明

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

現在のファイルの親を表す SplFileInfo オブジェクトを取得します。

パラメータ

class_name

使用したい SplFileInfo 派生クラスの名前。

返り値

ファイルの親のパスの SplFileInfo オブジェクトを返します。

例1 SplFileInfo::getPathInfo() の例

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

上の例の出力は、 たとえば以下のようになります。

string(8) "/usr/bin"

参考



add a note add a note User Contributed Notes SplFileInfo::getPathInfo
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites