Re: Array - partical path to the array's path....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wow, that seem to work...  Should have use "$suffix" instead of "$prefix" to
make it less confusing.

"Silvio Porcellana" <sporc@xxxxxx> wrote in message
news:43398984.9020505@xxxxxxxxx
> Scott Fletcher wrote:
>
> >What I want this to work instead is
> >[code]
> >  $array = array();
> >
> >  $array['col1']['col2'] = "Test #1";
> >  $array['col3']['col2'] = "Test #2";
> >
> >  $prefix = "['col3']['col2']";
> >
> >  echo $array.$prefix;  //Spitted out result as "Test #2"...
> >[/code]
> >
> >
> Try something like this:
> <code>
>   $var = "\$array".$prefix;
>   eval("echo  $var;");
> </code>
>
> HTH, cheers
> Silvio

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux