Home >Backend Development >PHP Problem >How to access a method in a php file
How to access a method in a php file
First, you can write the method name into the URL;
Then get the method name through "$_GET" in the php file;
$action = $_GET['action'];
Finally, call the method corresponding to the method name through the "call_user_func()" function, The return value is the value returned in the method.
$action = $_GET['action']; function test() { echo "测试"; } call_user_func($action);
Output result: ce
The above is the detailed content of How to access a method in a php file. For more information, please follow other related articles on the PHP Chinese website!