Skip to content

Instantly share code, notes, and snippets.

@0xMatt
Created October 27, 2016 14:34
Show Gist options
  • Save 0xMatt/44c5a81d3d7f798e84c225fe874367d6 to your computer and use it in GitHub Desktop.
Save 0xMatt/44c5a81d3d7f798e84c225fe874367d6 to your computer and use it in GitHub Desktop.
crappily filter by timestamp in last hour
<?php
foreach (new DirectoryIterator('./') as $fileInfo) {
if($fileInfo->isDot()) continue;
$file = $fileInfo->getBasename();
//var_dump($file);
// Get file date
$timestamp = explode('-', $file);
if(!array_key_exists(1, $timestamp)) {
continue;
}
if(date('U', $timestamp[1]) <= time() - 3600) {
var_dump($file);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment