php is_executable() function - how to check whether specific file is executable

php is_executable() function - how to check whether specific file is executable


is_executableFunction.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>php is_executable() function - how to check whether specific file is executable</title>
</head>

<body>
    <h2 style="color:OrangeRed; font-style:italic">
     php is_executable() function example:<br /> how to check whether specific file is executable
    </h2>
    <hr width="530" align="left" color="Orange" />
    <br />

<?php
 
 $file = "test.txt";
 echo "<font style=color:Green>";
  if(is_executable($file))
  {
   echo "file is executable(test.txt)? true";
   }
  else
  {
   echo "file is executable(test.txt)? false";
   }
 echo "</font>";
?>
</body>
</html>