is_executable

bool is_executable(string filename) 

Checks whether a file is executable.

Returns:

TRUE if executable; FALSE otherwise

Description:

Checks whether the specified file is executable.

Note:

The results of this function are cached. See clearstatcache() for details.

Example:

Determine whether a file is executable
$file = "testfile"; 

if(is_executable($file)) 
{
    echo ("File $file is executable."); 
} 
else 
{
    echo ("File $file is not executable."); 
} 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.