/*
函数url_parse用于解析url,使用时需要在前面定义
define('path_info',true);
需要解析时调用该函数,取值方法用回$_get['xxx']即可
*/
function url_parse()
{
if(!(isset($_server['path_info'])&&defined('path_info'))){return;}
$url = substr($_server['path_info'], 1);
$url = str_replace(array("'",'"','.htm','.html'), array('','','',''),$url);
$url = explode('/', $url);
$param_count = count($url);
for ($i = 0; $i < $param_count; $i += 2)
{
if (isset($url[$i + 1]) && !is_numeric($url[$i]))
{
$_get[$url[$i]] = $url[$i + 1];
}
}
unset($param_count,$url,$i);
}
?>
新闻热点
疑难解答