Ec(210000if(is_executable("test.txt & quot;) & nbsp; determine the file {& nbsp; echo & quot; executable file & quot; & nbsp; & nbsp; script ec (2); script
If (is_executable ("test.txt") // checks the file
{
Echo "file executable"; // output result
}
Else // if the file is not executable
{
Echo "file not executable"; // output information
}
//
Var_dump (is_file ("test.txt "))."
"; // Determine the file
Var_dump (is_file ("c:/windows "))."
"; // Determine the file
//
$ File = "test.txt"; // definition file
$ Filestat = stat ($ file); // returns the file information.
Print_r (array_slice ($ filestat, 13); // output the result
//
$ Path = pathinfo ("test.txt"); // defines path
Echo $ path ["dirname"]."
"; // Output array dirname
Echo $ path ["basename"]."
"; // Output result array basename
Echo $ path ["extension"]."
"; // Output result extension
//
$ Filename = "test.txt"; // definition file
If (is_writable ($ filename) // determines whether the file can be written.
{
Echo "file writable"; // output information
}
Else // if the file cannot be written
{
Echo "file not writable"; // output information
}
/*
The output result is similar:
File writable
*/
$ Filename = "test.txt"; // definition file
If (is_readable ($ filename) // checks whether the object is readable.
{
Echo "file readable"; // output information
}
Else // if the file is not readable
{
Echo "file unreadable"; // output information
}
/*
The output result is similar:
File readable
*/