Re: Tricky array question
| From: | Edward van Bilderbeek - Bean IT | Date: | Tue, 05 Feb 2002 10:07:35 +0000 |
| Subject: | Re: Tricky array question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-83566@lists.php.net to get a copy of this message | ||
try using something like this:
$varname = $categories[0];
echo ${$varname}[0];
Greets,
Edward
"Andy" <news.letters@gmx.de> wrote in message
news:<20020205100354.16285.qmail@pb1.pair.com>...
> Hi there,
>
> I have a tricky array question.
>
> My app is passing via post a array variable called glacier. Now I am
> checking for the content
> of this array. Because there are more of those arrays, I am getting all
the
> names out of a db.
>
> How is it possible to get the value and keep the name of the array
dynamic?
>
> e.g:
> Array name passed by post is: $glacier //
> contains e.g. $glacier[0] = testname
> Array with category names coming out of db is: $category // contains e.g.
> $category[0] = glacier
>
> echo $categories[0]; // returns glacier
> echo $glacier[0]; // returns testname
>
> I tryed $categories[0][0] but it returns only the first letter of glacier
> (g)
>
> Any ideas??
>
> Thanx, Andy
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php