1 개요[ | ]
- PHP file()
- 파일 내용을 배열로 읽어들이는 PHP 함수
2 예시 1[ | ]
Console
Copy
root@zetawiki:~# cat greet.txt
hello world
good morning
PHP
Copy
$f = file('greet.txt');
var_dump( $f );
# array(2) {
# [0]=>
# string(12) "hello world
# "
# [1]=>
# string(13) "good morning
# "
# }
3 예시 2[ | ]
PHP
Copy
$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 같이 보기[ | ]
- PHP readfile()
- PHP fopen()
- PHP fsockopen()
- PHP popen()
- PHP file_get_contents()
- PHP include
- PHP stream_context_create()
5 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.