hi,
i was wondering how to create variables on the fly,
by this i mean: i have a pair of strings or an associative array with one string for Key and another for Value:
or --------------
how could i manage to make of these two strings, a vairable with one becoming the name of the variable and the other the value.
is there a thing like:
?
Thankyou.
i was wondering how to create variables on the fly,
by this i mean: i have a pair of strings or an associative array with one string for Key and another for Value:
Code:
$var1 = 'hello'; $var2 = 'johnny';
Code:
array('hello'=>'johnny');
how could i manage to make of these two strings, a vairable with one becoming the name of the variable and the other the value.
Code:
echo $hello; //prints johnny
is there a thing like:
Code:
${$var1} = $var2;
Thankyou.
Comment