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

php动态调用方法

WBOY
Release: 2016-06-23 14:28:53
Original
821 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template