Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$files = glob('*');
$reports = array();
foreach ($files as $file) {
if (!is_numeric($file)) {
continue;
}
$time = filemtime($file);
$content = unserialize(file_get_contents($file));
$reports[] = array($time, $content, $file);
}
usort($reports, 'doSort');
foreach ($reports as $r) {
echo date('Y-m-d H:i:s', $r[0]), ' (', $r[2], '): ', str_replace("\n", ' ', $r[1][0]), PHP_EOL;
}
function doSort($a, $b)
{
return $a[0] - $b[0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment