SplFileObject::setFlags

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

SplFileObject::setFlagsSets flags for the SplFileObject

Description

public SplFileObject::setFlags(int $flags): void

Sets the flags to be used by the SplFileObject.

Parameters

flags

Bit mask of the flags to set. See SplFileObject constants for the available flags.

Return Values

No value is returned.

Examples

Example #1 SplFileObject::setFlags() example

<?php
$file 
= new SplFileObject("data.csv");
$file->setFlags(SplFileObject::READ_CSV);
foreach (
$file as $fields) {
    
var_dump($fields);
}
?>

See Also