Re: [PHP] Confusing array question ...

2002-09-10 Thread John Kelly
Thanks for the examples Zak! I got it working. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Confusing array question ...

2002-09-10 Thread Zak Greant
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey John, Actually, you don't seem to far off. You can use a string as a variable name by enclosing the string in ${ }. i.e: ${"foo"} You should be able to write your loop as something like: foreach($item as $value) { // do some stuff

Re: [PHP] Confusing array question ...

2002-09-10 Thread John Kelly
Thanks that did it! "Martin Towell" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Try adding curly braces around the var name, like this: > > for($i=0; $i -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.p

RE: [PHP] Confusing array question ...

2002-09-10 Thread Martin Towell
Try adding curly braces around the var name, like this: for($i=0; $imailto:[EMAIL PROTECTED]] Sent: Wednesday, September 11, 2002 9:27 AM To: [EMAIL PROTECTED] Subject: [PHP] Confusing array question ... Hi, I have 1 primary array called $item containing 20 values each of whose value is part

[PHP] Confusing array question ...

2002-09-10 Thread John Kelly
Hi, I have 1 primary array called $item containing 20 values each of whose value is part of the name of 20 other arrays containing various number of values. How can I cycle through the primary $item array using a foreach and within that do a for on each of the 20 secondary arrays dynamically inse