Mega Code Archive

 
Categories / Php / Functions
 

Using exec() to Produce a Directory Listing

<html> <head> <title>Using exec() to Produce a Directory Listing</title> </head> <body> <div> <?php exec( "ls -al .", $output, $return ); print "<p>Returned: $return</p>"; foreach ( $output as $file ) {   print "$file<br />"; } ?> </div> </body> </html>