Return to Snippet

Revision: 76809
at July 29, 2019 16:47 by martinbrait

Initial Code


    //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>";

Initial URL

Initial Description
List only certain files in a folder with PHP
Lists only certain files extensions as links on a page 
from a defined folder

Initial Title
Lister des fichiers en fonction de leur extension

Initial Tags
list, files, extension

Initial Language