Jump to content

Archived

This topic is now archived and is closed to further replies.

budeboy

Help with looping variables

Recommended Posts

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.

Share this post


Link to post
Share on other sites
[code]
<?
$i = 1;
while($i < 20){
echo "$week$i<br />";
$i++;
}[/code]

Hope that helps

Ray

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.