2 Star 4 Fork 1

vb2005xu/route.class.php

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.php 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
vb2005xu 提交于 2015-01-20 23:58 . 修改测试代码
<?php
require_once __DIR__ . '/route.class.php';
function index_init()
{
error_reporting(E_ALL | E_STRICT);
header("Content-Type: text/html;charset=utf-8");
$arr = array(
'/index.html',
'/student/index.html',
'/student/user/index.html',
'/student/user/role/index///.html',
'/index.xml',
'/student/index.xml',
'/student/user/index.xml',
'/student/user/role/index///.xml',
'/index.jsonp',
'/student/index.jsonp',
'/student/user/index.jsonp',
'/student/user/role/index.jsonp',
'/index.json',
'/student/index.json',
'/student/user/index.json',
'/student/user/role/index.jsonp',
);
foreach( $arr as $t )
{
Route::parse_url($t);
prety_printr($_GET);
$route_key = $_GET['q:route'];
unset($_GET['q:route']);
prety_printr( Route::rewrite_url($route_key, $_GET));
}
echo __FILE__;
EXIT;
}
function prety_printr($vars, $label = '', $return = false)
{
$content = "<pre>\n";
if ($label != '') {
$content .= "<strong>{$label} :</strong>\n";
}
$content .= htmlspecialchars(print_r($vars, true),ENT_COMPAT | ENT_IGNORE);
$content .= "\n</pre>\n";
if ($return) { return $content; }
echo $content;
}
index_init();
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/eemcmc/route.class.php.git
git@gitee.com:eemcmc/route.class.php.git
eemcmc
route.class.php
route.class.php
master

搜索帮助