W3Schools.com

PHP is_executable() Function


PHP Filesystem Reference 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


PHP Filesystem Reference Complete PHP Filesystem Reference
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE