I am using PHP 5's scandir($dir) function to iterate through a directory and print out an xml list of files. Only, when the directory has a single quote in the name, scandir returns no items! It doesn't return false (as it would if it failed) or generate warnings or errors - just empty. Any ideas?
$items = scandir(stripslashes($dir)); //strip slashes in case magic_quotes are on
if($items === false) die("scandir returned failure");
print_r($items)