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

Posted by Angelos on 03/14/06 12:30

Hello,

I need to dynamically specify the name of a variable. I just read that
$varA = "Cat";
echo $$varA;

OUTPUT: Cat

What I try to establish is somehow add a bit of text on my dynamic
variable name.
so:

$varA = "Cat";
$$varA.'Food' <------ I am not sure what should be the syntax in order
the variable name to be $CatFood

The reason I want to do that is because I take the first part of the
variable name from a Database.

Thanks.

 

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

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