In this article, you will learn how to check if the file extension is .exe in PHP or not. The is_executable() function in PHP checks whether the specified filename is executable.
what is the syntax of the IS_EXECUTABLE function in php?
is_executable(file)
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
examples of the IS_EXECUTABLE function
Example 1. In this example, we 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");
}
?>