Want more features on Pastebin? Sign Up, it's FREE!
Guest

Dynom

By: a guest on Jan 25th, 2010  |  syntax: PHP  |  size: 0.23 KB  |  views: 135  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data