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

热门教程

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

时间:2022-06-24 23:56:28 编辑:袖梨 来源:一聚教程网

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


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

list($name,$ext) = explode('.',$file);
echo $name;
 
if( is_file( $name.'.txt' ) )
{
 echo 'file存在';
}

if( file_exists( $file1 ) )
{
 echo 'file1存在';
}

热门栏目