This may sound confusing:
$myVar = "Helloooo!";
$text = "myVar";
How could i call $myVar from just the fact $text is filled with the variable name, perhaps this ? (it doesnt work though)
echo $($text);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
PHP has a feature called “variable variables“, that works exactly like you need it to.
You can use it almost like you posted, but without the brackets:
The best notation is using curly braces however, as that removes ambiguities when dealing with arrays.