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 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. 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 Link to comment https://forums.phpfreaks.com/topic/205396-loop-date-not-working/#findComment-1074890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.