- <?php
- $newfile = '11.txt';
- // 파일 생성
- $fmodify_w = fopen($newfile, "w");
- fputs($fmodify_w, "파일추가");
- fclose($fmodify_w);
- // 파일 읽기
- echo "파일 내용\n<br>";
- $outbyte = readfile($newfile);
- echo "\n<br>".$outbyte;
- /*
- 파일 내용
- 파일추가
- 8
- */
- ?>
--------------------------------------------------------------------------------------------
int readfile ( string $filename [, bool $use_include_path = false [, resource $context ]] )
11. 라인
파일 내용 출력후 출력 길이를 반환합니다.
'php5 > 파일관련함수' 카테고리의 다른 글
파일 상대경로을 절대경로로 반환 - string realpath ( string $path ) (0) | 2014.01.10 |
---|---|
파일 목록 배열 반환 - array scandir ( string $directory ) (0) | 2014.01.10 |
파일 업로드 관련 함수 (예제없음) (0) | 2014.01.10 |
파일 실행 가능 확인 - bool is_executable ( string $filename ) (0) | 2014.01.10 |
파일 일반파일 확인 - bool is_file ( string $filename ) (0) | 2014.01.10 |