PHP file()

Jmnote bot (토론 | 기여)님의 2020년 11월 2일 (월) 02:34 판 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

PHP file()
  • 파일 내용을 배열로 읽어들이는 PHP 함수

2 예시 1[ | ]

root@zetawiki:~# cat greet.txt 
hello world
good morning
$f = file('greet.txt');
var_dump( $f );
# array(2) {
#   [0]=>
#   string(12) "hello world
# "
#   [1]=>
#   string(13) "good morning
# "
# }

3 예시 2[ | ]

$f = file('http://zetawiki.com/ex/txt/utf8hello.txt');
var_dump( $f );
# array(3) {
#   [0]=>
#   string(4) "Hi.
# "
#   [1]=>
#   string(8) "안녕.
# "
#   [2]=>
#   string(16) "おはよう。
# "
# }

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}