update : 2015.11.03
php.shukuma.com검색:
|
SplFileObject::__construct(PHP 5 >= 5.1.0) SplFileObject::__construct — Construct a new file object. 설명
public SplFileObject::__construct
( string
$filename
[, string $open_mode = "r"
[, bool $use_include_path = false
[, resource $context
]]] )Construct a new file object. 인수
반환값값을 반환하지 않습니다. 오류/예외
Throws a RuntimeException if the 예제
Example #1 SplFileObject::__construct() example This example opens the current file and iterates over its contents line by line.
<?php 위 예제의 출력 예시: Line 0 is <?php Line 1 is $file = new SplFileObject(__FILE__); Line 2 is foreach ($file as $line_num => $line) { Line 3 is echo "Line $line_num is $line"; Line 4 is } Line 5 is ?> |