Check if specified file is executable with is_executable() function in PHP

Description

The following code shows how to check if specified file is executable with is_executable() function.

Example


  /*from ww w .  j a  va 2  s. c o  m*/
<?php
    $file = "a.php";
    if(is_executable($file)){
      echo ("$file is executable");
    }else{
      echo ("$file is not executable");
    }
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    File »




Directory
DirectoryIterator
Drive
File
File Permission
File Read Save
FileSystemIterator
Path
Zip