(PHP 5 >= 5.1.0, PHP 7)
SplFileObject类为文件提供了一个面向对象接口.
$delimiter = ","
   [, string $enclosure = "\""
   [, string $escape = "\\"
  ]]] ) : array$fields
   [, string $delimiter = ","
   [, string $enclosure = '"'
   [, string $escape = "\\"
  ]]] ) : int$delimiter = ","
   [, string $enclosure = "\""
   [, string $escape = "\\"
  ]]] ) : void$open_mode = "r"
   [, bool $use_include_path = FALSE
   [, resource $context = NULL
  ]]] ) : SplFileObjectSplFileObject::DROP_NEW_LINEDrop newlines at the end of a line.
SplFileObject::READ_AHEADRead on rewind/next.
SplFileObject::SKIP_EMPTYSkips empty lines in the file. This requires the READ_AHEAD flag be enabled, to work as expected.
SplFileObject::READ_CSVRead lines as CSV rows.
| 版本 | 说明 | 
|---|---|
| 5.3.9 | SplFileObject::SKIP_EMPTYvalue changed to 4.
        Previously, value was 6. |