当前位置:首页 > PHP教程 > php文件操作 > 列表

php判断文件是否存在file_exists 与 is_file详解

发布:smiling 来源: PHP粉丝网  添加日期:2013-11-29 13:41:58 浏览: 评论:0 

$file ='新建文本文档.txt';

  1. $file1 ='a.txt'; 
  2. list($name,$ext) = explode('.',$file); 
  3. echo $name; 
  4.  
  5. if( is_file( $name.'.txt' ) ) 
  6. { 
  7.  echo 'file存在'; 
  8. } 
  9. if( file_exists( $file1 ) ) 
  10. { 
  11.  echo 'file1存在'; 
  12. } 

Tags: php判断 文件 是否存在

分享到: