Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

is_executable()

Example

Verify the executability of the given filename:

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

What the code above might produce is:

setup.exe is executable

Definition and Usage

The function is_executable() determines if the filename provided is executable.

Note: This function caches its output. To clear the cache, use clearstatcache().

Syntax

is_executable(file)

Parameter Values

Parameter

Description

file

Essential. gives the location of the file to be checked.

Technical Details

 

Return Value:

When a file fails, it returns FALSE and an E_WARNING, and TRUE otherwise.

PHP Version:

4.0+