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]
|