CAn anyone tell me why this piece of code doesn't work?
Code: Select all
<?php
function readDirs($main){
$dirHandle = opendir($main);
while($file = readdir($dirHandle)){
if(is_dir($file) && $file != '.' && $file != '..'){
readDirs($file);
}
else{
echo $file . '<br/>';
}
}
}
$dir = '../../lib';
readDirs($dir);
?>
Code: Select all
.
..
technical