PHP: List Directories And Files On my server

May 13th, 2009

I found the easiest solution for listing directories and files on my server. Please take a look below:

<?
$dir = “images/”; //You could add a $_GET to change the directory
$files = scandir($dir);
foreach($files as $key => $value){
echo $value; //You could add an icon in here maybe, a link to the file/directory, or a link to list files in that directory
}
?>

2 Responses to “PHP: List Directories And Files On my server”

  1. NICK Says:


    MedicamentSpot.com. Canadian Health&Care.Special Internet Prices.Best quality drugs.No prescription online pharmacy. High quality pills. Buy drugs online

    Buy:Zocor.Lasix.Aricept.Wellbutrin SR.Benicar.Cozaar.Nymphomax.Lipitor.Prozac.Buspar.Female Pink Viagra.Zetia.Acomplia.Seroquel.Lipothin.Advair.Ventolin.SleepWell.Female Cialis.Amoxicillin….

  2. keyword research pro discount Says:

    amazing stuff thanx :)

Leave a Reply

Filled Under: PHP