Skip to content

Instantly share code, notes, and snippets.

@daum
Created August 20, 2017 20:15
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 daum/da680e5bac8a00a96038fab2f43f0c92 to your computer and use it in GitHub Desktop.
Save daum/da680e5bac8a00a96038fab2f43f0c92 to your computer and use it in GitHub Desktop.
<?php
// Generate the start timestamp
$start = time();
// Do other stuff....
// If the end timestamp is over 7 weeks in seconds throw an error
if( strtotime('+7 days') - $start > 86400) {
throw new \Exception('must be less than 7 weeks');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment