Skip to content

Instantly share code, notes, and snippets.

@steverobbins
Last active June 22, 2018 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steverobbins/960c0c03353fc7a696230e1487ac1cf6 to your computer and use it in GitHub Desktop.
Save steverobbins/960c0c03353fc7a696230e1487ac1cf6 to your computer and use it in GitHub Desktop.
<?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