budeboy Posted March 2, 2006 Share Posted March 2, 2006 im trying to write a script that echos information in variables using a loop I know the code below is wrong but its the best way i could describe the sort o thing im trying to do[code]$i = 1;while($i < 20){ echo "$week$i";}[/code]is the sort of thing im trying to do is there a way to do a loop that echos variable $week1 then $week2 and so on intill $i = 20. Quote Link to comment https://forums.phpfreaks.com/topic/3933-help-with-looping-variables/ Share on other sites More sharing options...
craygo Posted March 2, 2006 Share Posted March 2, 2006 [code]<?$i = 1;while($i < 20){echo "$week$i<br />";$i++;}[/code]Hope that helpsRay Quote Link to comment https://forums.phpfreaks.com/topic/3933-help-with-looping-variables/#findComment-13662 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.