PHP 像框架一样分段获取URL /**分段获取URL * @param {Object} $num */ public function u($num){ $url = array(); $url = trim(str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['REQUEST_URI']), '/'); $url = explode('/', $url); return $url[$num-1]; } PHP 像框架一样分段获取URL