Ok, this works- http://www.puretricks.com/hi.php this doesn't work- http://www.puretricks.com/videos/hi.php The only difference is one is in a directory and one is not, here is the code- <?php if(!function_exists('scandir')) { function scandir($dir, $sortorder = 0) { if(is_dir($dir)) { $dirlist = opendir($dir); while( ($file = readdir($dirlist)) !== false) { if(!is_dir($file)) { $files[] = $file; } } ($sortorder == 0) ? asort($files) : arsort($files); return $files; } else { return FALSE; break; } } } function dirlist($dir) { foreach(scandir($dir) as $entry) if($entry != '.' && $entry != '..') { $entry = $dir.'/'.$entry; $path = pathinfo($entry); $listarray[] = $path['basename']; } return($listarray); } $arr = dirlist("/kunden/homepages/15/d161670145/htdocs/__puretricks/videos"); foreach ($arr as $value) { if (is_dir("/kunden/homepages/15/d161670145/htdocs/__puretricks/videos/".$value)) { $value2 = preg_replace('/_/',' ',$value); echo $value2."<BR>"; } } ?> PHP: Why?