Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick Loop Question!

Status
Not open for further replies.

Shanksta

Technical User
Jun 28, 2002
96
US
Hi everyone I have a quick question regarding loops that I need help with...

I basically have a loop that runs 6 times for 6 GET vars, named v1 though v6. I want to run one loop that will print them back out and was wondering how to go about this.

The loop starts:

$i = 1;
while($i < 7){
$i = $i + 1;
}

I wanted to use the $i variable when I go though so I could quickly reprint the GET vars, something like:

$_GET[v . "$i"] or $_GET[v . echo($i);]

How can I do this???

 
Code:
for ($i=0; $i<7;$i++)
{
 echo $_GET["v".$i];
 echo "<br />";
}

or even easier:
Code:
print_r($_GET);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top