johnsmith153 Posted June 4, 2009 Share Posted June 4, 2009 Hi, sorry, very simple, but I always forget this I want to run a "for" loop 10 times i.e: <?php for () { echo $a."<br>"; } ?> ..so it will output 1 2 3 4 5 6 7 8 9 10 Link to comment https://forums.phpfreaks.com/topic/160955-solved-ultra-simple/ Share on other sites More sharing options...
Andy-H Posted June 4, 2009 Share Posted June 4, 2009 for ($i = 1; $i < 10; $i++) { echo $i . '<br >'; } Link to comment https://forums.phpfreaks.com/topic/160955-solved-ultra-simple/#findComment-849405 Share on other sites More sharing options...
Maq Posted June 4, 2009 Share Posted June 4, 2009 That will only go up to 9. Change it to $i johnsmith, A little googling and you could have easily gotten the answer to this. Please make an attempt yourself first. Link to comment https://forums.phpfreaks.com/topic/160955-solved-ultra-simple/#findComment-849407 Share on other sites More sharing options...
MadTechie Posted June 4, 2009 Share Posted June 4, 2009 Direct from the manual <?php /* example 1 */ for ($i = 1; $i <= 10; $i++) { echo $i; } //... snip ?> Link to comment https://forums.phpfreaks.com/topic/160955-solved-ultra-simple/#findComment-849418 Share on other sites More sharing options...
roopurt18 Posted June 4, 2009 Share Posted June 4, 2009 Sounds like a take home quiz to me. Link to comment https://forums.phpfreaks.com/topic/160955-solved-ultra-simple/#findComment-849486 Share on other sites More sharing options...
MadTechie Posted June 4, 2009 Share Posted June 4, 2009 I'm going to mark this as solved but please remember to click topic solved (bottom left) Link to comment https://forums.phpfreaks.com/topic/160955-solved-ultra-simple/#findComment-849535 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.