文章詳情頁
php 如何獲取第一個參數?
瀏覽:100日期:2022-06-02 15:41:28
問題描述
大佬們
URL鏈接如下 https://www.baidu.cn/?d&b_scene_zt=1&renqun_youhua=375297
如何獲取第一個?后面的參數呢
問題解答
回答1:$test = parse_url("http://localhost/index.php?name=tank&sex=1#top");print_r($test);
試試
回答2:試一下
$url = "https://www.baidu.cn/?d&b_scene_zt=1&renqun_youhua=375297";echo parse_url($url)['query'];$str = explode("&",parse_url($url)['query']);
echo '<pre>'.print_r($str,true).'';
上一條:登錄功能報錯下一條:請問這是jeson嗎?如何遍歷出來?
相關文章:
排行榜
