if (is_executable ("test.txt"))//to judge a file
{
echo "File executable"; Output results
}
else//If the file is not executable
{
echo "File not executable"; Output information
}
//
Var_dump (Is_file ("Test.txt")). " <br> "; To judge a file
Var_dump (Is_file ("C:/windows")). " <br> "; To judge a file
//
$file = "Test.txt"; Definition file
$filestat =stat ($file); Return file information
Print_r (Array_slice ($filestat, 13)); Output results
//
$path =pathinfo ("test.txt"); Define Path
echo $path ["DirName"]. " <br> "; Output array dirname
echo $path ["basename"]. " <br> "; Output result Array basename
echo $path ["extension"]. " <br> "; Output results Extension
//
$filename = "Test.txt"; Definition file
if (is_writable ($filename))//Determine if the file is writable
{
echo "File writable"; Output information
}
else//If the file is not writable
{
echo "File not writable"; Output information
}
/*
The output is similar to the following:
Files can be written
*/
$filename = "test.txt"; //definition file
If is_readable ($ filename)) //to determine if the file is readable by
{
echo "File readable"; //output Information
}
else //If the file is not readable
{
echo "file is unreadable"; //output Information
}
/*
Output is similar to:
File readable
*/