Home >Backend Development >PHP Tutorial >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."";
}
?>