PHP judge whether a file or directory exists method is very simple PHP to determine whether a file or directory has its own function, file_exists file exists, determine whether the directory exists we use Is_dir OK.
PHP Tutorial to determine if a file or directory exists
The method is very simple PHP to determine whether a file or directory has its own function, file_exists file exists, determine whether the directory exists we use Is_dir OK.
*/
$file = "Data.txt";
$dir = "Www.bkjia.com/newdata";
if (file_exists ($file))
{
echo "Files in current directory". $file. " Existence ";
echo "
";
}
Else
{
echo "Files in current directory". $file. " does not exist ";
echo "
";
}
echo "
";
echo "
";
echo "
";
if (Is_dir ($dir))
{
echo "Current directory, directory". $dir. " Existence ";
echo "
";
}
Else
{
echo "Current directory, directory". $dir. " does not exist ";
echo "
";
}
http://www.bkjia.com/PHPjc/445442.html www.bkjia.com true http://www.bkjia.com/PHPjc/445442.html techarticle PHP judge whether a file or directory exists method is very simple PHP to determine whether a file or directory has its own function, file_exists file exists, to determine whether the directory exists we use Is_ ...