PHP의 TMPFILE () 함수
정의 및 사용
TMPFILE () 함수는 모드 (+ w) 읽기 - 쓰기의 고유 한 파일 이름을 가진 임시 파일을 만듭니다.
문법
tmpfile()
팁과주의 사항
참고 : 파일이 닫혀 임시 파일 후 (FCLOSE 사용하여 ()), 또는 스크립트가 자동으로 삭제 종료 될 때.
팁 :적인 tempnam ()를 참조하십시오.
예
<?php
$temp = tmpfile();
fwrite($temp, "Testing, testing.");
//Rewind to the start of file
rewind($temp);
//Read 1k from file
echo fread($temp,1024);
//This removes the file
fclose($temp);
?>
$temp = tmpfile();
fwrite($temp, "Testing, testing.");
//Rewind to the start of file
rewind($temp);
//Read 1k from file
echo fread($temp,1024);
//This removes the file
fclose($temp);
?>
가 출력 위의 코드 :
Testing, testing.
PHP 파일 시스템 참조 설명서를 완료