The following script works fine for the current directory:
<?php
$ignore = array ('.', '..', '.DS_Store', 'index.php');
$num_ordnernamen = array ();
if ($handle = opendir('./')) {
while (false !== ($entry = readdir($handle))) {
if (!in_array($entry, $ignore) && is_dir($entry)) {
array_push($num_ordnernamen, $entry);
}
}
}
print_r ($num_ordnernamen);
?>
, it returns the array as it should:
Array ( [0] => firstfolder [1] => secondfolder )
It does, however, not work for
if ($handle = opendir('../')) //or
if ($handle = opendir('..')) //or
if ($handle = opendir('../..'))
… or anything else I try to get one level up. What am I missing here?