Hi,
I have an array of array of strings :-
$g1 = array("453", "592");
$g2 = array("e14", "e15", "e13");
$groups = array($g1, $g2);
I traverse and print out the value using :-
for ($i = 0; $i < sizeof($groups); $i++) {
for ($j = 0; $j < sizeof($groups[$i]); $j++) {
print "<!--=$groups[$i][$j]=-->\n"; /* line?? */
}
}
But the end result is :-
<!--=Array[0]=-->
<!--=Array[1]=-->
<!--=Array[0]=-->
My expected result is :-
<!--=453=-->
<!--=592=-->
<!--=e14=-->
But when I change the line from:-
print "<!--=$groups[$i][$j]=-->\n"; /* line?? */
to include :-
$cid = $groups[$i][$j];
print "<!--=$cid=-->\n"; /* line?? */
I seem to get the results I want.
Why is this? Is there a syntax error?
Thanx
--
Ken
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php