Re: Converting string to array index
| From: | Bastien | Date: | Sun, 06 Nov 2011 04:55:22 +0000 |
| Subject: | Re: Converting string to array index | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-315602@lists.php.net to get a copy of this message | ||
On 2011-11-05, at 10:21 PM, Ethan Rosenberg <ethros@earthlink.net> wrote:
> Dear list -
>
> I have an associative array that will return a string representing an array index. I now need
> to convert this string into an actual array index.
>
> $test1 = array
> (
> "e1" => "[4][7]",
> "e2" => "[5][8]"
> );
>
> so.. $z = $test1['e1'];
> z has the value of [4][7]. I need to convert this string to an array index so I can use it in
> $results[4][7].
>
> How do I do it?
>
> Thanks.
>
> Ethan
>
> MySQL 5.1 PHP 5.3.3-6 Linux [Debian squeeze(sid)]
>
>
> --
>
Array_flip()?
http://php.net/manual/en/function.array-flip.php
Bastien