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, 18 Sep 2009

view this page in

SplFileObject::getFlags

(PHP 5 >= 5.1.0)

SplFileObject::getFlagsGets flags for the SplFileObject

Описание

public int SplFileObject::getFlags ( void )

Gets the flags set for an instance of SplFileObject as an integer.

Параметри

Тази функция няма параметри.

Връщани стойности

Returns an integer representing the flags.

Примери

Example #1 SplFileObject::getFlags example

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

if (
$file->getFlags() & SplFileObject::SKIP_EMPTY) {
    echo 
"Skipping empty lines\n";
} else {
    echo 
"Not skipping empty lines\n";
}

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

if (
$file->getFlags() & SplFileObject::SKIP_EMPTY) {
    echo 
"Skipping empty lines\n";
} else {
    echo 
"Not skipping empty lines\n";
}
?>

Примерът по-горе ще изведе нещо подобно на:

Not skipping empty lines
Skipping empty lines

Вж. също



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