PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

SplFileObject クラス | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

SplFileObject クラス

(PHP 5 >= 5.1.0, PHP 7)

はじめに

SplFileObject クラスはファイルのためのオブジェクト指向のインターフェイスを提供します。

クラス概要

SplFileObject extends SplFileInfo implements RecursiveIterator , SeekableIterator {
/* 定数 */
const integer DROP_NEW_LINE = 1 ;
const integer READ_AHEAD = 2 ;
const integer SKIP_EMPTY = 4 ;
const integer READ_CSV = 8 ;
/* メソッド */
public string|array current ( void )
public bool eof ( void )
public bool fflush ( void )
public string fgetc ( void )
public array fgetcsv ([ string $delimiter = "," [, string $enclosure = "\"" [, string $escape = "\\" ]]] )
public string fgets ( void )
public string fgetss ([ string $allowable_tags ] )
public bool flock ( int $operation [, int &$wouldblock ] )
public int fpassthru ( void )
public int fputcsv ( array $fields [, string $delimiter = "," [, string $enclosure = '"' [, string $escape = "\" ]]] )
public string fread ( int $length )
public mixed fscanf ( string $format [, mixed &$... ] )
public int fseek ( int $offset [, int $whence = SEEK_SET ] )
public array fstat ( void )
public int ftell ( void )
public bool ftruncate ( int $size )
public int fwrite ( string $str [, int $length ] )
public void getChildren ( void )
public array getCsvControl ( void )
public int getFlags ( void )
public int getMaxLineLen ( void )
public bool hasChildren ( void )
public int key ( void )
public void next ( void )
public void rewind ( void )
public void seek ( int $line_pos )
public void setCsvControl ([ string $delimiter = "," [, string $enclosure = "\"" [, string $escape = "\\" ]]] )
public void setFlags ( int $flags )
public void setMaxLineLen ( int $max_len )
public void __toString ( void )
public bool valid ( void )
/* 継承したメソッド */
public SplFileInfo::__construct ( string $file_name )
public int SplFileInfo::getATime ( void )
public string SplFileInfo::getBasename ([ string $suffix ] )
public int SplFileInfo::getCTime ( void )
public string SplFileInfo::getExtension ( void )
public SplFileInfo SplFileInfo::getFileInfo ([ string $class_name ] )
public string SplFileInfo::getFilename ( void )
public int SplFileInfo::getGroup ( void )
public int SplFileInfo::getInode ( void )
public string SplFileInfo::getLinkTarget ( void )
public int SplFileInfo::getMTime ( void )
public int SplFileInfo::getOwner ( void )
public string SplFileInfo::getPath ( void )
public SplFileInfo SplFileInfo::getPathInfo ([ string $class_name ] )
public string SplFileInfo::getPathname ( void )
public int SplFileInfo::getPerms ( void )
public string SplFileInfo::getRealPath ( void )
public int SplFileInfo::getSize ( void )
public string SplFileInfo::getType ( void )
public bool SplFileInfo::isDir ( void )
public bool SplFileInfo::isExecutable ( void )
public bool SplFileInfo::isFile ( void )
public bool SplFileInfo::isLink ( void )
public bool SplFileInfo::isReadable ( void )
public bool SplFileInfo::isWritable ( void )
public SplFileObject SplFileInfo::openFile ([ string $open_mode = "r" [, bool $use_include_path = false [, resource $context = NULL ]]] )
public void SplFileInfo::setFileClass ([ string $class_name = "SplFileObject" ] )
public void SplFileInfo::setInfoClass ([ string $class_name = "SplFileInfo" ] )
public void SplFileInfo::__toString ( void )
}

定義済み定数

SplFileObject::DROP_NEW_LINE

行末の改行を読み飛ばします。

SplFileObject::READ_AHEAD

先読み/巻き戻しで読み出します。

SplFileObject::SKIP_EMPTY

ファイルの空行を読み飛ばします。期待通りに動作させるには、READ_AHEAD フラグを有効にしないといけません。

SplFileObject::READ_CSV

CSV 列として行を読み込みます。

変更履歴

バージョン 説明
5.3.9 SplFileObject::SKIP_EMPTY の値が 4 に変わりました。前のバージョンでは、値は 6 でした。

目次


忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「SplFileObject クラス」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | SplFileObject クラス」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: