08-29-2009, 08:08 AM
|
#1 (permalink)
|
|
The Acquainted
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
|
Listing files and folders with scandir
I'm making a little script that will list the files and folders in a certain directory. Currently it looks like:
PHP Code:
<?php
//Scan the directory
$scan = scandir("../www");
//Loop through the array
echo "<ul>";
foreach($scan as $key=>$value){
echo "<li>".$value."</li>";
}
echo "</ul>";
Ideally I'd like to differentiate between what's a file and what's a folder. How would I do this?
|
|
|