indestructibleman
02-14-2008, 05:35 PM
is there a way to execute a loop with multiple arrays so that $f[0] will correspond with $s[0] and $f[1] will correspond to $s[1], etc . . . ?
for example
int $first[] = {0,1,2,3,4};
int $second[] = {0,1,2,3,4};
for ($f in $first)
for ($s in $second )
{
print $f;
print ($s + "\n");
}
this returns
00
01
02
03
04
10
11
12
13
14
etc . . .
could it be made to return only
00
11
22
33
44
?
thanks,
will
for example
int $first[] = {0,1,2,3,4};
int $second[] = {0,1,2,3,4};
for ($f in $first)
for ($s in $second )
{
print $f;
print ($s + "\n");
}
this returns
00
01
02
03
04
10
11
12
13
14
etc . . .
could it be made to return only
00
11
22
33
44
?
thanks,
will
