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 不存在";
}
?>
本文标题: PHP 检查文件是否存在 file_exists 函数
本文链接: https://crm.yallacn.com/jiaocheng/302.html (转载时请注明来源链接)
本文说明: 有问题或投稿请发送至: 邮箱/service@zhimatong.com QQ/1174742835
特别鸣谢: 如果您觉得本文对您有帮助,请给我们一个小小的赞,收藏本文更利于反复学习哦!



交流群
购物车