首页  >  文章  >  后端开发  >  php file_exists函数怎么用

php file_exists函数怎么用

藏色散人
藏色散人原创
2019-05-25 10:22:582884浏览

php file_exists函数用于检查文件或目录是否存在,其语法是file_exists(path),参数path是必需,指规定要检查的路径。

php file_exists函数怎么用

php file_exists函数怎么用?

作用:检查文件或目录是否存在。

语法:

file_exists(path)

参数:

path 必需。规定要检查的路径。        

说明:

如果指定的文件或目录存在则返回 true,否则返回 false。

php file_exists()函数使用示例

<?php
$file = file_exists("./test.txt");
echo $file;
?>

以上是php file_exists函数怎么用的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn