Last active
May 29, 2016 04:22
-
-
Save nishinoshake/52cf4fc320ec743a2ee9 to your computer and use it in GitHub Desktop.
PHPで新しいかの判定
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
function judgeNew($postedDate) { | |
$past = 7; // 1 week | |
if ( strtotime($postedDate) >= strtotime('-' . $past . ' day') ) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment