把数组中的元素添加到链接中,形成新的链接

599 阅读1分钟

形成的链接: http://localhost/index/cate/listt?id=123&name=dopost

        $uurl_array =array ( 'id' =>123, 'name' => 'dopost' );
        $now_url = 'http://'.$_SERVER['HTTP_HOST'].'/index/cate/listt?'.http_build_query( $uurl_array );
        echo $now_url;

更多精彩文章请关注 王明昌博客