robert_gsfame Posted June 21, 2010 Share Posted June 21, 2010 I have this code <?php $exp=explode("-","2010-09-20"); $first=$exp[0]+10; $last=$exp[0]-10; for($i=$first;$i<$last;$i++){ echo $i;}?> no result appear...which part is wrong? thx Quote Link to comment https://forums.phpfreaks.com/topic/205396-loop-date-not-working/ Share on other sites More sharing options...
trq Posted June 21, 2010 Share Posted June 21, 2010 If $last starts off less then $first your loop will never iterate. Look at your logic. Quote Link to comment https://forums.phpfreaks.com/topic/205396-loop-date-not-working/#findComment-1074889 Share on other sites More sharing options...
robert_gsfame Posted June 21, 2010 Author Share Posted June 21, 2010 haha...wrongly typed Thx a lot thorpe! when do the coding i was almost fell asleep Quote Link to comment https://forums.phpfreaks.com/topic/205396-loop-date-not-working/#findComment-1074890 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.