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

search for in the

SplFileObject::getMaxLineLen> <SplFileObject::getCurrentLine
[edit] Last updated: Fri, 25 May 2012

view this page in

SplFileObject::getFlags

(PHP 5 >= 5.1.0)

SplFileObject::getFlagsSplFileObject のフラグを取得する

説明

public int SplFileObject::getFlags ( void )

SplFileObject のインスタンス用のフラグセットを integer 形式で取得します。

パラメータ

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

返り値

フラグを表す integer を返します。

例1 SplFileObject::getFlags() の例

<?php
$file 
= new SplFileObject(__FILE__"r");

if (
$file->getFlags() & SplFileObject::SKIP_EMPTY) {
    echo 
"空行を読み飛ばします\n";
} else {
    echo 
"空行を読み飛ばしません\n";
}

$file->setFlags(SplFileObject::SKIP_EMPTY);

if (
$file->getFlags() & SplFileObject::SKIP_EMPTY) {
    echo 
"空行を読み飛ばします\n";
} else {
    echo 
"空行を読み飛ばしません\n";
}
?>

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

空行を読み飛ばしません
空行を読み飛ばします

参考



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

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