the value of another (already set) variable.
Ie:
I want to do this:
(I am just assuming it won't work; I haven't even tried it yet)
$var1='apple';
$Fruit_$var1=organic;
echo $Fruit_apple; // I want this to return organic
Or how are you guys dynamically naming PHP vars on the fly
haven't even tried it yet)
$var1='apple';
$Fruit_$var1=organic;
echo $Fruit_apple; // I want this to return organic
Or how are you guys dynamically naming PHP vars on the fly?
John Butler (Govinda)
govinda.webdnat...@gmail.com
--
PHP General Mailing List (http://www.php.net
You can use variable variables
...
You can make more complicated statements with this technique.
$var1 = 'apple';
${ 'Fruit_' . $var1 } = 'organic';
echo $Fruit_apple; // here you are
thank you all 3, for your help!
That was just what I wanted!
-Govinda
--
PHP General Mailing List
3 matches
Mail list logo