PHP.nl

is_executable

is_executable

Tells whether the filename is executable

bool **is_executable** string $filename

Tells whether the filename is executable.

filenamePath to the file.

Returns true if the filename exists and is executable, or false on error. On POSIX systems, a file is executable if the executable bit of the file permissions is set. For Windows, see the note below.

Voorbeeld: example

<?php

$file = '/home/vincent/somefile.sh';

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

?>

Opmerking: > On Windows, a file is considered executable, if it is a properly executable file as reported by the Win API ; for BC reasons, files with a or extension are also considered executable. Prior to PHP 7.4.0, any non-empty file with a or extension was considered executable. Note that is irrelevant for . GetBinaryType()``is_executable

is_file``is_link