SHARE
TWEET

Untitled

a guest Jan 21st, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $year = 2012;
  3. $month = 1;
  4. $inputDatePast = intval(sprintf('%4d%02d', $year, $month)); //201201
  5.  
  6. $year = 2016;  // if you read this after september 2016: add a few more years here ;)
  7. $month = 9;
  8. $inputDateFuture = intval(sprintf('%4d%02d', $year, $month)); //201609
  9.  
  10. $prevMonth = intval(date('Ym', mktime(12, 0, 0, date('n')-1, 1, date('Y'))));
  11.  
  12. $validator = new Zend_Validate_GreaterThan($prevMonth);
  13. $validator->isValid($inputDatePast); // false
  14. $validator->isValid($inputDateFuture); // true
  15. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top