(PHP 4, PHP 5, PHP 7)
is_writable — 锟叫断革拷锟斤拷锟斤拷锟侥硷拷锟斤拷锟角凤拷锟叫�
$filename
) : bool
锟斤拷锟斤拷募锟斤拷锟斤拷诓锟斤拷铱锟叫达拷蚍祷锟� TRUE
锟斤拷filename
锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷欠锟斤拷写锟斤拷锟斤拷目录锟斤拷锟斤拷
锟斤拷住 PHP 也锟斤拷只锟斤拷锟斤拷锟斤拷锟斤拷 webserver 锟斤拷锟矫伙拷锟斤拷锟斤拷通锟斤拷为 'nobody'锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷锟斤拷锟斤拷锟斤拷锟诫安全模式锟斤拷锟斤拷锟狡★拷
filename
要锟斤拷锟斤拷锟侥硷拷锟斤拷锟狡★拷
锟斤拷锟斤拷募锟� filename
锟斤拷锟节诧拷锟揭匡拷写锟津返伙拷 TRUE
锟斤拷
Example #1 is_writable() 锟斤拷锟斤拷
<?php
$filename = 'test.txt';
if (is_writable($filename)) {
echo 'The file is writable';
} else {
echo 'The file is not writable';
}
?>
失锟斤拷时锟阶筹拷E_WARNING
锟斤拷锟芥。
Note: 锟剿猴拷锟斤拷锟侥斤拷锟斤拷岜伙拷锟斤拷妗o拷渭锟� clearstatcache() 锟皆伙拷酶锟斤拷锟较革拷凇锟�
锟斤拷 PHP 5.0.0 锟斤拷, 锟剿猴拷锟斤拷也锟斤拷锟斤拷某些 URL 锟斤拷装锟斤拷锟斤拷锟斤拷渭锟� 支锟街碉拷协锟斤拷头锟阶靶拷锟�锟皆伙拷锟街э拷锟� stat() 系锟叫猴拷锟斤拷锟斤拷锟杰的帮拷装锟斤拷锟叫憋拷