<?php //http://works.io/php/0807/route.php/admin/index/abc //echo "<pre>"; //echo $_SERVER['REQUEST_URI']; //print_r($_SERVER); $uri = $_SERVER['REQUEST_URI']; $request = explode('/', $uri); $route = array_slice($request, 4); list($module, $controller, $action) = $route; $pathinfo = compact('module', 'controller', 'action'); echo '<pre>'. print_r($pathinfo, true); // echo call_user_func_array(function(){return "我是方法".__FUNCTION__;},[]); //echo call_user_func_array('abc',[$action]); if(isset($action)){ echo call_user_func_array(function($a){ return "我是方法" .$a;},[$action]); }