SHARE
TWEET

Dynom

a guest Jan 25th, 2010 135 Never
  1. <?php
  2. // Cool native comparing with objects !
  3. $dateStart = new DateTime('yesterday');
  4. $dateEnd = new DateTime('tomorrow');
  5. if ($dateEnd < $dateStart) {
  6.     echo 'Woops, reverse order!';
  7. } else {
  8.     echo 'All good, carry on.';
  9. }
RAW Paste Data
Top