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

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
5번째 줄: 5번째 줄:
*로컬파일, 원격파일 모두 가능
*로컬파일, 원격파일 모두 가능


<source lang='php'>
<syntaxhighlight lang='php'>
$str = file_get_contents('test.txt');
$str = file_get_contents('test.txt');
echo $str;
echo $str;
# John Smith
# John Smith
</source>
</syntaxhighlight>
<source lang='php'>
<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번째 줄:
# 안녕.
# 안녕.
# おはよう。
# おはよう。
</source>
</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 같이 보기[ | ]

3 참고[ | ]