Ryan55
12-01-2010, 10:58 AM
Hey,
I have an array of all the folders in a directory using scandir and i then want to echo out the array but not using print_r. I just want a list of all the folders but the array is going to change depending on the number of folders and i want to be able to echo them all out except the last 2 which are just . and ..
My code is below -
$dir = 'templates';
$files = scandir($dir, 1);
echo "<pre>";
print_r($files);
echo "</pre>";
I have an array of all the folders in a directory using scandir and i then want to echo out the array but not using print_r. I just want a list of all the folders but the array is going to change depending on the number of folders and i want to be able to echo them all out except the last 2 which are just . and ..
My code is below -
$dir = 'templates';
$files = scandir($dir, 1);
echo "<pre>";
print_r($files);
echo "</pre>";