bool file_exists ( string $file_open );
检查文件或目录是否存在。
file_open - 文件或目录的路径。
链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-file-exists.html
来源:LearnFk无涯教程网
如果file_open指定的文件或目录存在,则返回true;否则返回false。
<?php $file_open='/home/httpd/index.htm'; if (file_exists($file_open)) { echo "The file $file_open exists"; }else { echo "The file $file_open does not exist"; } ?>
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)