Return to Snippet

Revision: 64349
at July 27, 2013 01:13 by kidmizere


Updated Code
<?php
//Define directory for files listing
//original example
//$files = glob('/path/to/dir/*.xml');
$files = glob('*.php');
//to limit what is displayed you can use a diff listing:
//$files = array_diff($files, array('index.php','opendb.php'));

foreach ($files as $value) {
echo "<a href=http://changetoyoursite/$value>".$value."</a><br>";
}


?>

Revision: 64348
at July 27, 2013 01:08 by kidmizere


Initial Code
<?php
//Define directory for files listing
//original example
//$files = glob('/path/to/dir/*.xml');
$files = glob('*.php');

foreach ($files as $value) {
echo "<a href=http://changetoyoursite/$value>".$value."</a><br>";
}


?>

Initial URL


Initial Description
Lists only certain files extensions as links on a page from a defined folder

Initial Title
List only certain files in a folder with PHP

Initial Tags
php, list, files

Initial Language
PHP