[php]代码库
function convertUrlQuery($query)
{
$queryParts = explode('&', $query);
$params = array();
foreach ($queryParts as $param)
{
$item = explode('=', $param);
$item[0] = str_replace('amp;','',$item[0]);
$params[$item[0]] = $item[1];
}
return $params;
}
function getUrlQuery($array_query)
{
$tmp = array();
foreach($array_query as $k=>$param)
{
$tmp[] = $k.'='.$param;
}
$params = implode('&',$tmp);
return $params;
}
$url = parse_url($post['url']);
$host = 'http://'.$url['host']. $url['path'].'?';
$arr_query = convertUrlQuery($url['query']);
print_r($arr_query);