PHP is_executable() Function

❮ PHP Filesystem Reference

Example

Check whether the specified filename is executable:

<?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


Definition and Usage

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

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

Syntax

is_executable(file)

Parameter Values

Parameter Description
file Required. Specifies the path to the file to check


Technical Details

Return Value: TRUE if the file is executable, FALSE and an E_WARNING on failure
PHP Version: 4.0+

❮ PHP Filesystem Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.