Using exec() to Produce a Directory Listing : System Command « Development « PHP






Using exec() to Produce a Directory Listing

<html>
<head>
<title>Using exec() to produce a directory listing</title>
</head>
<body>
<?php
exec( "ls -al .", $output, $return );
print "<p>Returned: $return</p>";

foreach ( $output as $file )
   print "$file<br>";
?>
</table>
</body>
</html>

           
       








Related examples in the same category

1.Porter scanner
2.Ping server
3.Execute shell command 'dir'
4.Ping command
5.Execute help command and check its output
6.Calling the man Command
7.Using popen() to Read the Output of the UNIX who Command
8.Using popen() to Pass Data to the column Application