Error: “Parse error: syntax error, unexpected T_FUNCTION”
Php Version: 5.2.17
Problem line:
#removing ignored files
$files = array_filter($files, function($file) use ($ignore) {return !in_array($file, $ignore);});
[php]
<?php $path = ("../photos/wide/"); $files = scandir($path); $ignore = array( 'cgi-bin', '.', '..'); #removing ignored files $files = array_filter($files, function($file) use ($ignore) {return !in_array($file, $ignore);}); #getting the modification time for each file $times = array_map(function($file) use ($path) {return filemtime("$path/$file");}, $files); #sort the times array while sorting the files array as well array_multisort($times, SORT_DESC, SORT_NUMERIC, $files); foreach ($files as $file) { echo ''; } ?>
[/php]