"PHP file get contents()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 2명의 중간 판 13개는 보이지 않습니다)
1번째 줄: 1번째 줄:
{{DISPLAYTITLE:PHP file_get_contents()}}
==개요==
==개요==
;file_get_contents()
;PHP file_get_contents()
*전체파일을 문자열로 읽어들이는 PHP 함수
*전체파일을 문자열로 읽어들이는 PHP 함수
*로컬파일, 원격파일 모두 가능
<syntaxhighlight lang='php'>
$str = file_get_contents('test.txt');
echo $str;
# John Smith
</syntaxhighlight>
<syntaxhighlight lang='php'>
$str = file_get_contents('http://zetawiki.com/ex/txt/utf8hello.txt');
echo $str;
# Hi.
# 안녕.
# おはよう。
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[함수 file_get_contents()]]
* [[PHP file()]]
*[[PHP file()]]
* [[PHP fgets()]]
*[[PHP fgets()]]
* [[PHP fread()]]
*[[PHP fread()]]
* [[PHP readfile()]]
*[[PHP readfile()]]
* [[PHP file_put_contents()]]
*[[PHP file_put_contents()]]
* [[PHP stream_getcontents()]]
*[[PHP stream_getcontents()]]
* [[PHP stream_context_create()]]
*[[PHP stream_context_create()]]
* [[PHP $http_response_header]]
*[[PHP $http_response_header]]
* [[PHP file_get_contents() 타임아웃 적용]]
*[[PHP Warning: URL file-access is disabled in the server configuration]]
* [[PHP Warning: URL file-access is disabled in the server configuration]]
* [[PHP 함수 curl_get_contents()]]
* [[함수 file_get_contents()]]


==참고 자료==
==참고==
*http://php.net/manual/en/function.file-get-contents.php
*http://php.net/manual/en/function.file-get-contents.php
*http://www.w3schools.com/php/func_filesystem_file_get_contents.asp


[[분류: PHP]]
[[분류: PHP 파일시스템 함수]]

2020년 11월 2일 (월) 02:57 기준 최신판

1 개요[ | ]

PHP file_get_contents()
  • 전체파일을 문자열로 읽어들이는 PHP 함수
  • 로컬파일, 원격파일 모두 가능
$str = file_get_contents('test.txt');
echo $str;
# John Smith
$str = file_get_contents('http://zetawiki.com/ex/txt/utf8hello.txt');
echo $str;
# Hi.
# 안녕.
# おはよう。

2 같이 보기[ | ]

3 참고[ | ]

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