PHP is_readable()函数 is_readable() 函数可以检查指定的文件是否可读。如果文件可读,该函数可以返回 true。 语法 bool is_readable ( string $filename )PHPCopy 这个函数可以判断文件是否存在且可读。 示例 <?php file = "/PhpProject/php/phptest.txt"; if(is_readable(file)) { echo ("file is readable"); } else { echo ("file is not readable"); } ?>PHPCopy 输出 /PhpProject/php/phptest.txt is readablePHPCopy