[thelist] PHP time based for/next loop

Damien COLA damiencola at wanadoo.fr
Sun Jan 18 05:55:01 CST 2004


Yes you do, for that kind of situation, 
either you don't round the value :
intval($myminutes/4.0);

either you do a if () else 4 times, that isn't too hard.
or even simpler, without else :
if ($myminutes <= 59) then $x = 45
if ($myminutes < 45) then $x = 30
if ($myminutes < 30) then $x = 15
if ($myminutes < 15) then $x = 0


-----Original Message-----
I think I've got to the "wood for trees" stage...

What I want is minutes between 0 and 14 to use the 00 option, 15 to 29 
to use the 15 option, 30 to 44 to use the 30 option and 45-59 to use the

45 option.  But, I don't want to have to loop 60 times.



More information about the thelist mailing list