Home >Backend Development >PHP Tutorial >php动态调用方法

php动态调用方法

WBOY
WBOYOriginal
2016-06-23 14:28:53807browse

 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."";
 }
?>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn