List all files of a directory with php
Free Scripts :: PHP :: Files and Folders :: List all files of a directory with php
Author: Salman Javaid
Website: http://www.salman.be
Website: http://www.salman.be
- How to list all files of a directory with php.
- Display all files from a folder with php.
This scripts lists all files and folders located at given path.
Script
$path='products/images/';
$handle=opendir($path);
while (($file = readdir($handle))!==false){
if ($file!="." && $file!=".."){
echo $file . ', ';
}
}
Output
img01.jpg, img02.jpg, img05.jpg, img07.jpg, img15.jpg




