You are here: Re: Problem accessing variable variabla arrays ... « PHP « IT news, forums, messages
Re: Problem accessing variable variabla arrays ...

Posted by Yorn de Jong on 02/10/05 23:17

WFX wrote:
> Hi all !
>
> I've declared variables like this :
>
> $buttons[1]["name"] = "Test";
>
> And now, for some reasons, I want to access to this value
> dynamically throught variable variable.
>
> Example :
>
> $var_name = "buttons";
> $var_index1 = 1;
> $var_index2 = "name";
> echo ${$var_name}[$var_index1][$varindex2];
>
> Doesn't display anything ... instead of "Test".
>
> Can someone help me ?

I would try this:

echo $$var_name[$var_index1][$var_index2];

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация