schme16 Posted June 14, 2008 Share Posted June 14, 2008 can php do this: $variable = 'some_variable'; $($variable) = 'the'; echo $some_variable; and get an output of 'the'. I know that Actionscript can and so can a few others.... but I was wondering if php can too.. Link to comment https://forums.phpfreaks.com/topic/110186-solved-using-a-variable-to-make-a-variable/ Share on other sites More sharing options...
thebadbad Posted June 14, 2008 Share Posted June 14, 2008 http://dk2.php.net/language.variables.variable <?php $test = 'Hello world!'; $name = 'test'; echo $$name; //Hello world! ?> Link to comment https://forums.phpfreaks.com/topic/110186-solved-using-a-variable-to-make-a-variable/#findComment-565462 Share on other sites More sharing options...
Guest Xanza Posted June 14, 2008 Share Posted June 14, 2008 Yup, variable variable is what you're looking at... But I've never really found them too much help. Example: http://xanza.info/math.php http://xanza.info/math.phps Link to comment https://forums.phpfreaks.com/topic/110186-solved-using-a-variable-to-make-a-variable/#findComment-565465 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.