php is_executable function is used to determine whether a certain file can be executed. If the file exists and is executable, it returns TRUE. If an error occurs, it returns FALSE. This article introduces you to the basic syntax and usage examples of the is_executable function.
php is_executable function introduction
is_executable function is used to determine whether the given file name is executable
Syntax:
bool is_executable ( string $filename )
Determine whether the given file name is executable.
Parameters:
filename The path to the file.
Return value:
TRUE if the file exists and is executable, FALSE on error.
php is_executable function example
Use is_executable to determine whether the permissions.php file is executable. The code is as follows:
<?php $file_name="permissions.php"; //Only works on Windows with PHP 5.0.0 or later if(is_executable($file_name)) { echo ("The file $file_name is executable.<br />"); } else { echo ("The file $file_name is not executable.<br />"); } ?>
The above is the collection of information on php is_executable to determine whether a given file name is executable. We will continue to add related information in the future. Information, thank you for your support of this site!
For more articles on php is_executable to determine whether a given file name is executable, please pay attention to the PHP Chinese website!