PHP의 is_writable () 함수
정의 및 사용
지정된 파일이 쓰기 가능 여부를 is_writable () 함수를 확인합니다.
파일이 기록 될 수있는 경우, 함수는 TRUE를 반환.
문법
is_writable(file)
参数 | 描述 |
---|---|
file | 必需。规定要检查的文件。 |
팁과주의 사항
참고 :이 함수의 결과는 캐시됩니다.캐시를 지우려면 싶으면 clearstatcache ()를 사용합니다.
예
<?php
$file = "test.txt";
if(is_writable($file))
{
echo ("$file is writeable");
}
else
{
echo ("$file is not writeable");
}
?>
$file = "test.txt";
if(is_writable($file))
{
echo ("$file is writeable");
}
else
{
echo ("$file is not writeable");
}
?>
가 출력 위의 코드 :
test.txt is writeable
PHP 파일 시스템 참조 설명서를 완료