Blog Archives

PHP for loop that goes to certain number and again starts from zero


Here is the code that actually worked in my case : $start_time = some_dynamic_value; $end_time = some_dynamic_value; $i= $start_time; $flag = false; if($start_time > $end_time) $flag = true; while ($i <= $end_time || $flag) { echo $i; if($i == 24)

Tagged with: ,
Posted in PHP
Follow me on Twitter

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 443 other subscribers