Revision: 28723
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 13, 2010 07:04 by vagrantradio
Initial Code
$thehour = date('G'); foreach (range(0, 7) as $number) { $morning[$number] = $number; } foreach (range(8, 15) as $number) { $day[$number] = $number; } foreach (range(16, 23) as $number) { $evening[$number] = $number; } if(in_array($thehour,$morning)) { echo 'it\'s morning'; } // 00:00 - 07:59am elseif(in_array($thehour,$day)) { echo 'it\'s day'; } // 08:00 - 15:59pm elseif(in_array($thehour,$evening)) { echo 'it\'s evening'; } // 16:00pm - 23:59pm
Initial URL
http://wordpress.org/support/topic/249486
Initial Description
Display anything based on the time of day
Initial Title
Display based on time of day
Initial Tags
wordpress
Initial Language
PHP