Originally posted by Shrike
function_cmp should be function cmp. Can't explain the other errors w/out seeing the code.
ah.... that's odd. In all my text editors, the underscore shows up as just a regular space, except it does show up when posting the code here. I fixed that, here's the code now:
$dir = '/Users/harrison/Sites/images/photos/thumbnails';
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))){
if ($file != "." && $file != ".." && $file != ".DS_Store"){
$files[] = array($file, filemtime($dir."/".$file));
}
closedir($handle);
}
}
uksort($files, "cmp");
function cmp($a, $b){
return strcasecmp($files[$a][1], $files[$b][1]);
}
now I get the errors:
Warning: readdir(): 2 is not a valid Directory resource in/Users/harrison/Sites/archives/pixels/photographs/index.php on line 123
Warning: uksort(): The argument should be an array in/Users/harrison/Sites/archives/pixels/photographs/index.php on line 131