(→같이 보기) |
Jmnote bot (토론 | 기여) 잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight )) |
||
5번째 줄: | 5번째 줄: | ||
*로컬파일, 원격파일 모두 가능 | *로컬파일, 원격파일 모두 가능 | ||
< | <syntaxhighlight lang='php'> | ||
$str = file_get_contents('test.txt'); | $str = file_get_contents('test.txt'); | ||
echo $str; | echo $str; | ||
# John Smith | # John Smith | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight lang='php'> | ||
$str = file_get_contents('http://zetawiki.com/ex/txt/utf8hello.txt'); | $str = file_get_contents('http://zetawiki.com/ex/txt/utf8hello.txt'); | ||
echo $str; | echo $str; | ||
16번째 줄: | 16번째 줄: | ||
# 안녕. | # 안녕. | ||
# おはよう。 | # おはよう。 | ||
</ | </syntaxhighlight> | ||
==같이 보기== | ==같이 보기== |
2020년 11월 2일 (월) 02:57 기준 최신판
1 개요[ | ]
- PHP file_get_contents()
- 전체파일을 문자열로 읽어들이는 PHP 함수
- 로컬파일, 원격파일 모두 가능
PHP
Copy
$str = file_get_contents('test.txt');
echo $str;
# John Smith
PHP
Copy
$str = file_get_contents('http://zetawiki.com/ex/txt/utf8hello.txt');
echo $str;
# Hi.
# 안녕.
# おはよう。
2 같이 보기[ | ]
- PHP file()
- PHP fgets()
- PHP fread()
- PHP readfile()
- PHP file_put_contents()
- PHP stream_getcontents()
- PHP stream_context_create()
- PHP $http_response_header
- PHP file_get_contents() 타임아웃 적용
- PHP Warning: URL file-access is disabled in the server configuration
- PHP 함수 curl_get_contents()
- 함수 file_get_contents()
3 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.