Created
October 27, 2016 14:34
-
-
Save 0xMatt/44c5a81d3d7f798e84c225fe874367d6 to your computer and use it in GitHub Desktop.
crappily filter by timestamp in last hour
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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