http://php.net/print_r
--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Dale Robinson" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, March 09, 2001 2:04 PM
Subject: [PHP] dynamically accessing arrays at variable indexes
> Hi,
>
> I need to access array values at varying dimensions.
>
> What I want to do is something like this:
>
> $full_index = ["op"]["view"];
>
> print ${"HTTP_GET_VARS" . $full_index};
>
> but that doesnt work :(
>
> A messy solution would be:
>
> function return_array_value($index1, $index2)
> {
> if ($index2) {
> return $HTTP_GET_VARS[$index1][$index2];
> } else {
> return $HTTP_GET_VARS[$index1];
> }
> }
>
> but this would mean I would have to continue adding 'if' clauses if I
wanted
> to access values more than one dimension deep.
>
> Is there a neat way of getting at array values dynamically?
>
> D. Robinson
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]