Latest web development tutorials
 

PHP is_executable() Function


< Complete PHP Filesystem Reference

Definition and Usage

The is_executable() function checks whether the specified file is executable.

This function returns TRUE if the file is executable.

Syntax

is_executable(file)

Parameter Description
file Required. Specifies the file to check

Tips and Notes

Note: The result of this function are cached. Use clearstatcache() to clear the cache.

Note: The is_executable() function became available with Windows in PHP 5.0


Example

<?php
$file = "setup.exe";
if(is_executable($file))
  {
  echo ("$file is executable");
  }
else
  {
  echo ("$file is not executable");
  }
?>

The output of the code above could be:

setup.exe is executable

< Complete PHP Filesystem Reference