Php check for the top of the hour


/ Published in: PHP
Save to your folder(s)

Php check for the top of the hour


Copy this code and paste it in your HTML
  1. <?php
  2. $minutes = date('i'); // We'll go by the minutes of the hour so that we don't have to compare to all 24 possible outcomes
  3.  
  4. if($minutes == '00'){ // if the minutes are 0 which should be the top of the hour
  5. echo "true"; // then pass a true to the refresh function
  6. } else{
  7. echo "false"; // if not, pass a false
  8. }
  9. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.