Possible Duplicate:
foreach with three variables add
I'm new to PHP so bear with me.
I have a url with two variables like so:
?foo=1,2,3,4&bar=a,b,c,d
Both parameters will always have the same amount of elements. I need to loop through the amount of elements like so:
1a
2b
3c
4d
and on each iteration assign two variables for foo
and bar
value.
If this was javascript no problem, but I have no idea how to do this PHP. This is what I have:
$foo = strtok($rvar_foo,",");
$bar = strtok($rvar_bar,",");
while ( $foo ){
# now how do I get the corresponding value for $bar?
}