Re: [PHP] dynamically naming PHP vars on the fly?

2009-08-05 Thread Martin Scotta
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

Re: [PHP] dynamically naming PHP vars on the fly?

2009-08-05 Thread Jerry Wilborn
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

Re: [PHP] dynamically naming PHP vars on the fly?

2009-08-05 Thread Govinda
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