How to access the PHP function of a class where the function is stored in variable?
For example:
$functionname = "say_hello";
$obj = new Class();
$obj -> $functionname();
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.
if function name is stored in a variable check if it is exists and is callable like
then check if it is callable