Home >Backend Development >PHP Tutorial >刚建的仅2k的可配置的PHP URL 路由 http://code.google.com/p/qserouter/
刚刚建的仅2k的可配置的PHP URL 路由 http://code.google.com/p/qserouter/
地址: http://code.google.com/p/qserouter/ 上午刚刚建的 :-)<?phprequire 'router.php';function dump($vars, $label = '', $return = false){ if (ini_get('html_errors')) { $content = "<pre class="brush:php;toolbar:false">\n"; if ($label != '') { $content .= "<strong>{$label} :</strong>\n"; } $content .= htmlspecialchars(print_r($vars, true)); $content .= "\n\n"; } else { $content = $label . " :\n" . print_r($vars, true); } if ($return) { return $content; } echo $content; return null;}$routes = new Router(require('mapping.php'));$testarr = array( '/', '/abc', '/abc/d', '/books/13', '/books/13/java', '/admin', '/admin/', '/admin/abc', '/admin/abc/d',);foreach ($testarr as $item){ dump($routes->filter($_GET,$item),$item); }?>