PHP 파일() 함수
❮ PHP 파일 시스템 참조예시
파일을 배열로 읽습니다.
<?php
print_r(file("test.txt"));
?>
정의 및 사용
file()은 파일을 배열로 읽습니다.
각 배열 요소에는 줄 바꿈 문자가 계속 첨부된 파일의 한 줄이 포함됩니다.
통사론
file(filename, flag, context)
매개변수 값
Parameter | Description |
---|---|
filename | Required. Specifies the path to the file to read |
flag |
Optional. Can be one or more of the following constants:
|
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream. Can be skipped by using NULL. |
기술적 세부 사항
반환 값: | 어레이의 전체 파일, 실패 시 FALSE |
---|---|
PHP 버전: | 4.0+ |
바이너리 금고: | 예, PHP 4.3에서 |
❮ PHP 파일 시스템 참조