jd2007 Posted September 4, 2007 Share Posted September 4, 2007 how do i make a string act like a variable ? for e.g, i want this string '$hello' treated as the variable $hello ? Quote Link to comment https://forums.phpfreaks.com/topic/67896-how-do-i-make-a-string-act-like-a-variable/ Share on other sites More sharing options...
jd2007 Posted September 4, 2007 Author Share Posted September 4, 2007 pls help Quote Link to comment https://forums.phpfreaks.com/topic/67896-how-do-i-make-a-string-act-like-a-variable/#findComment-341267 Share on other sites More sharing options...
sasa Posted September 4, 2007 Share Posted September 4, 2007 try $hello = 123; $a ='hello'; echo $$a; Quote Link to comment https://forums.phpfreaks.com/topic/67896-how-do-i-make-a-string-act-like-a-variable/#findComment-341270 Share on other sites More sharing options...
jd2007 Posted September 4, 2007 Author Share Posted September 4, 2007 thanks...it works Quote Link to comment https://forums.phpfreaks.com/topic/67896-how-do-i-make-a-string-act-like-a-variable/#findComment-341277 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.