You are here: Re: Dynamic Variable Name $$var « PHP Programming Language « IT news, forums, messages
Re: Dynamic Variable Name $$var

Posted by Angelos on 03/14/06 17:05

Kimmo Laine wrote:
> "Angelos" <angelos@redcatmedia.net> wrote in message
> news:dv68u4$ba4$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
>
>>I worked it out I think:
>>
>>$a = "a";
>>$b = "b";
>>$varA = $a.$b;
>>
>>$$varA = "jack";
>>echo "Dog name is: ".$ab;
>
>
> You can also use the curly braces so you don't need to always assign a new
> variable for that. Example:
>
> $alpha = 'a';
> $beta = 'b';
> ${$alpha.$beta} = 'all your phps are belong to us';
> echo $ab;
>
OHhh thats Great !!!
Thanks .... Much better way of doing the same thing. ;)

 

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

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