To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 23 December 2004 07:39, Song Ken Vern-E11804 wrote:

> 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?? */         
>       } }

   print "<!--={$groups[$i][$j]}=-->\n";

(Note curly braces.)

Inside strings, PHP does not parse beyond the first-level subscript by
default; enclosing the whole reference in {} gives PHP the clue it needs to
use both levels of subscripting.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to