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

search for in the

SplFileObject> <SplFileInfo::setInfoClass
[edit] Last updated: Fri, 25 May 2012

view this page in

SplFileInfo::__toString

(PHP 5 >= 5.1.2)

SplFileInfo::__toStringファイルへのパスを文字列で返す

説明

public void SplFileInfo::__toString ( void )

このメソッドは、参照するファイルのファイル名を返します。

パラメータ

この関数にはパラメータはありません。

返り値

ファイルへのパスを返します。

例1 SplFileInfo::__toString() の例

<?php
$info 
= new SplFileInfo('foo');
var_dump($info->__toString());
echo 
$info.PHP_EOL;

$info = new SplFileInfo('/usr/bin/php');
var_dump($info->__toString());
echo 
$info.PHP_EOL;
?>

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

string(3) "foo"
foo
string(12) "/usr/bin/php"
/usr/bin/php 



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

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