一聚教程网:一个值得你收藏的教程网站

热门教程

php is_file 判断文件存在

时间:2022-06-24 21:41:33 编辑:袖梨 来源:一聚教程网

//用户判断文章是否存 is_file file_exists函数实现

 代码如下 复制代码
 function isFile($path)
 {
  if( file_exists($path) && is_file($path))
 {
  return true;
 }
 else
 {
  return false;
 }
 }

 //注意is_file 与 file_exists函数不能判断绝对路径如我上面的$_path ='/upfile/'就会显示找不到文件,如果用../upfile/就OK了,

热门栏目