728x90
반응형
- 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.
# 안녕.
# おはよう。
728x90
반응형
'Web Programming > php' 카테고리의 다른 글
php $_GET $_POST (0) | 2018.09.05 |
---|---|
php new line to br nl2br() (0) | 2018.09.05 |
PHP 문자열 길이 (strlen, mb_strlen 함수) (0) | 2018.09.04 |
php data types (0) | 2018.09.04 |
php include, require (0) | 2018.09.03 |