Reply to Re: Need education: Question about indirect referencing

Your name:

Reply:


Posted by lwoods on 01/15/06 21:24

That's the structure that I'm looking for.

Thanks.

Larry

"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:43ca4a97$0$79824$dbd45001@news.euronet.nl...
> lwoods wrote:
>> I want to echo the value of key 'a' by indirectly referencing it via
>> the variable $y. The above is NOT correct, I know.
>>
>> How do I indirectly reference a variable in PHP?
>>
>
> The technique is called 'Variable variables' and looks like this:
>
> $x=array('a'=>'ant','b'=>'boat');
> $s='a';
> $y='s'; // Removed the dollar sign
> echo $x[$$y];
>
>
> JW
>
>

[Back to original 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

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