(PHP 4, PHP 5, PHP 7)
is_readable — 锟叫断革拷锟斤拷锟侥硷拷锟斤拷锟角凤拷啥锟�
$filename
) : bool锟叫断革拷锟斤拷锟侥硷拷锟斤拷锟角凤拷锟斤拷诓锟斤拷铱啥锟斤拷锟�
filename
锟侥硷拷锟斤拷路锟斤拷锟斤拷
锟斤拷锟斤拷锟� filename
指锟斤拷锟斤拷锟侥硷拷锟斤拷目录锟斤拷锟节诧拷锟揭可讹拷锟津返伙拷 TRUE
锟斤拷锟斤拷锟津返伙拷 FALSE
锟斤拷
Example #1 is_readable() 锟斤拷锟斤拷
<?php
$filename = 'test.txt';
if (is_readable($filename)) {
echo 'The file is readable';
} else {
echo 'The file is not readable';
}
?>
失锟斤拷时锟阶筹拷E_WARNING
锟斤拷锟芥。
锟斤拷住 PHP 也锟斤拷只锟斤拷锟斤拷锟斤拷锟斤拷 webserver 锟斤拷锟矫伙拷锟斤拷锟斤拷通锟斤拷为 'nobody'锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷锟斤拷锟斤拷锟斤拷锟诫安全模式锟斤拷锟斤拷锟狡★拷 Safe mode limitations are not taken into account before PHP 5.1.5.
Note: 锟剿猴拷锟斤拷锟侥斤拷锟斤拷岜伙拷锟斤拷妗o拷渭锟� clearstatcache() 锟皆伙拷酶锟斤拷锟较革拷凇锟�
锟斤拷 PHP 5.0.0 锟斤拷, 锟剿猴拷锟斤拷也锟斤拷锟斤拷某些 URL 锟斤拷装锟斤拷锟斤拷锟斤拷渭锟� 支锟街碉拷协锟斤拷头锟阶靶拷锟�锟皆伙拷锟街э拷锟� stat() 系锟叫猴拷锟斤拷锟斤拷锟杰的帮拷装锟斤拷锟叫憋拷
Note:
The check is done using the real UID/GID instead of the effective one.
锟斤拷锟斤拷目录锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷芑岱碉拷锟� TRUE
锟斤拷锟斤拷使锟斤拷 is_dir() 锟斤拷锟斤拷锟斤拷锟侥硷拷锟斤拷目录锟斤拷