previousFile (Previous) (Next) 定数next

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

導入

導入 – File クラス導入

詳細

File は、 PHP に組み込まれたファイルとディレクトリ関数と パスを処理するいくつかの関数への簡単なインターフェースを提供します。

Example

File の使用

<?php
require_once 'File.php';

$file "/home/tal/example.txt";

//Echo the whole file
echo File::readAll($file);

//Now use a different approach
$fp = new File();

//Write a single line to the file, using a Macintosh EOL character and
//truncating the file before writing to it
$fp->writeLine($file"This is a single line"FILE_MODE_WRITE"\r");

//strip leading and trailing separators from the file path
echo $fp->stripLeadingSeparators($file);
echo 
$fp->stripTrailingSeparators($file);

?>
previousFile (Previous) (Next) 定数next

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.