将一个query后面的参数转为数组

function detailUri($params)
{
    $returnParams = array();
    if (isset($params))
    {
        $arParams = explode("&", $params);
        foreach ($arParams as $param)
        {
            $query = explode("=", $param);
            if ($query[0] && $query[1])
            {
                $returnParams[$query[0]] = $query[1];
            }
        }
    }
    return $returnParams;
}

  

posted @ 2015-06-11 13:37  笑月儿  Views(2420)  Comments(0Edit  收藏  举报