Can I check for a variable key without using a temporary variable.
$var = 'blabla';
$key = "{$var}_abc";
if(isset($someobject->$key))...
?
with arrays you can do this… $array[“{$var}_abc”]
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.
Yes. You can use curly braces containing an expression resulting in a string, where that string is the name of the property you want to check.