RE: [PHP] Re: Seams not to be possible
| From: | UGBI) | Date: | Thu, 07 Feb 2002 15:46:07 +0000 |
| Subject: | RE: [PHP] Re: Seams not to be possible | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-83857@lists.php.net to get a copy of this message | ||
$glacer[0]="test";
$category[0]="glacer";
echo ${$category[0]}[0];
echo returns test. That is what you wanted to do??????
> -----Original Message-----
> From: Aric Caley [mailto:greywire@peoplecatcher.net]
> Sent: Thursday, February 07, 2002 4:46 PM
> To: php-general@lists.php.net
> Subject: [PHP] Re: Seams not to be possible
>
>
> maybe you could use eval():
>
> eval("echo \$" . $field");
>
> ----- Original Message -----
> From: "Andy" <news.letters@gmx.de>
> Newsgroups: php.general
> To: <php-general@lists.php.net>
> Sent: Tuesday, February 05, 2002 2:57 AM
> Subject: Seams not to be possible
>
>
> > This was just an error in my explenation I ment categories.
> >
> > Meanwhile I tryed var vars, but it does not work for any reason?!?!?
> >
> > My code looks like:
> >
> > $field = $categories[0]."[0]";
> > echo $field; // returns glacier[0]
> > echo 'var '.$$field.'<br>'; // returns bluddy nothing
> > echo $categories[0]; // returns glacier
> > echo $glacier[0]; // returns 110
> >
> > Does anybody know how to get the 110 out of the array?????
> >
> > Thanx for any help,
> >
> > Andy
> > "Andy" <news.letters@gmx.de> schrieb im Newsbeitrag
> > 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
>
The information contained in this email is confidential and
may be legally privileged. It is intended solely for the
addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any
form of disclosure, production, distribution or any action
taken or refrained from in reliance on it, is prohibited and
may be unlawful. Please notify the sender immediately.
The content of the email is not legally binding unless
confirmed by letter bearing two authorized signatures.