使用字符串变量加载方法


Loading a method using a string variable

我怎么能像这样工作:

$parameter = "get_something()";
$value = $this->method->$parameter;

我得到错误"undefined property $get_something()"(注意$).

尝试使用

$name = "get_something";
$value = $this->method->$name();
相反,