PHP动态调用方法实例代码_PHP教程
时间:2021-07-01 10:21:17
帮助过:3人阅读
PHP 动态调用方法实例代码如下:
require_once showErrMsg.php;
$_action = (isset($_REQUEST[action])?$_REQUEST[action]:"");
if($_action!=null&&$_action!=){
if(function_exists($_action)){
eval("$_action();");
}else{
die(showErrMsg ( "
当前php文件中不存在方法[
".$_action."()]。"));
}
}
?>
function showErrMsg($strMsg){
return "
".$strMsg."";
}
?>
http://www.bkjia.com/PHPjc/486103.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/486103.htmlTechArticlePHP 动态调用方法实例代码如下: ?php require_once showErrMsg.php; $_action = (isset($_REQUEST[action])?$_REQUEST[action]:""); if($_action!=null$_action!=){ if(function_e...