bugcoder Posted August 3, 2010 Share Posted August 3, 2010 must be v easy to answer for many here but i dont know how to do it how can i use for loop to print values between any range but with increment of 0.5 0 0.5 1 1.5 2 2.5 3 ........till n Link to comment https://forums.phpfreaks.com/topic/209647-for-loop-with-5-increment/ Share on other sites More sharing options...
bh Posted August 3, 2010 Share Posted August 3, 2010 Hi, for loop Read the notes too. Link to comment https://forums.phpfreaks.com/topic/209647-for-loop-with-5-increment/#findComment-1094492 Share on other sites More sharing options...
bugcoder Posted August 3, 2010 Author Share Posted August 3, 2010 got that thanks <? for($i=0;$i<20;$i+=.5){ echo $i.'<br>'; } ?> Link to comment https://forums.phpfreaks.com/topic/209647-for-loop-with-5-increment/#findComment-1094493 Share on other sites More sharing options...
Yesideez Posted August 3, 2010 Share Posted August 3, 2010 Just advise not to use short tags - these (I believe) are being disabled by default now which means code you write now will have to be edited to work on other systems. <?php not <? Link to comment https://forums.phpfreaks.com/topic/209647-for-loop-with-5-increment/#findComment-1094495 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.