php is_executable determines whether the given file name is executable instance

高洛峰
Release: 2023-03-03 20:40:01
Original
1224 people have browsed it

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 />");
}
?>
Copy after login

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!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!