PHP 检查文件是否存在 file_exists 函数
PHP file_exists() 函数用于检查一个文件或目录是否存在 ...
file_exists() 函数用于检查一个文件或目录是否存在。
file_exists()
file_exists() 函数检查文件或目录是否存在,成功返回 TRUE,否则返回 FALSE 。
语法:
bool file_exists( string filename )
例子:
<?php $filename = 'test.txt'; if (file_exists($filename)) { echo "文件 $filename 存在"; } else { echo "文件 $filename 不存在"; } ?>
本文属原创,转载请注明原文:http://www.zhimatong.com/jiaocheng/302.html
为保证教程的实用性及扩大知识面覆盖,如果您有相似问题而未解决,可联系在线客服免费技术支持。
内容有用