index.php/user/search/name/joe/location/UK/gender/male
我需要用个function函数来get到比如,$_GET['location']=UK加入 function url_get($v){}
我直接用url_get('location')可以获取到UK参数,这个函数怎么写啊,请高手指点下

解决方案 »

  1.   

    你这个URL开启重写了吗? 你看 $_GET['location'];能直接得到吗得不到再来想别的办法。
      

  2.   

    index.php/user/search/name/joe/location/UK/gender/male
    就是因为获取不到这个内容啊
      

  3.   

    function url_get($v) {
      preg_replace('#([^/]+)/([^/]+)#e', '${$1}="$2"', substr($_SERVER['PATH_INFO'], 1));
      return $$v;
    }
      

  4.   

    所有我想用url_get('location')函数形式来处理这个带斜杠的url处理完后返回值