地址: http://code.google.com/p/qserouter/ 上午刚刚建的 :-)
<?php
require 'router.php';
function dump($vars, $label = '', $return = false)
{
if (ini_get('html_errors')) {
$content = "<pre>\n";
if ($label != '') {
$content .= "<strong>{$label} :</strong>\n";
}
$content .= htmlspecialchars(print_r($vars, true));
$content .= "\n</pre>\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);
}
?>
- qserouter.rar (3.4 KB)
- 下载次数: 0