PHP is_executable to determine if the given file name is an executable instance

Source: Internet
Author: User
The PHP is_executable function is used to determine whether a file can be executed, if the file exists and the executable returns TRUE, the error returns false, this article introduces the basic syntax and usages of the is_executable function.

Introduction to PHP is_executable functions

The Is_executable function is used to determine whether a given file name is executable

Grammar:

BOOL Is_executable (String $filename)

Determines whether the given file name can be executed.

Parameters:

The path to the filename file.

return value:

Returns TRUE if the file exists and can be executed, false when the error is returned.

PHP is_executable Function Instance

Use is_executable to determine if the permissions.php file can be executed with the following code:

<?php$file_name= "permissions.php"; Only works on Windows with PHP 5.0.0 or Laterif (is_executable ($file _name)) {  echo ("The file $file _name is executabl e.<br/> ");} else {  echo ("The file $file _name is not executable.<br/>");}? >

The above is the PHP is_executable to determine whether the given file name can be executed data collation, follow-up continue to supplement the relevant information, thank you for the support of this site!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.