Created
November 24, 2011 18:13
-
-
Save vidalon/1391959 to your computer and use it in GitHub Desktop.
Rounding up expires param on PHP
This file contains 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
$roundup = 15 * 60; //Roundup time in seconds, 15 minutes | |
//Round up the expires time to 15 minutes unless otherwise specified | |
if (!array_key_exists('expires', $params)) { | |
$params['expires'] = (floor(time()/$roundup) * $roundup) + $roundup; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment