您的位置 首页 php

php解析url获取url中的参数值

本文给大家介绍php解析url并得到url中的参数及获取url参数的方式,本文代码简单易懂,感兴趣的朋友一起看看吧

代码如下

$url = 'http://www.baidu.com/index.php?m=content&c=index&a=lists&catid=6&area=0&author=0&h=0®ion=0&s=1&page=1';parse_str(parse_url($url)[query],$query_arr);var_dump($query_arr);

结果

array (size=10)          'm' => string 'content' (length=7)          'c' => string 'index' (length=5)          'a' => string 'lists' (length=5)          'catid' => string '6' (length=1)          'area' => string '0' (length=1)          'author' => string '0' (length=1)          'h' => string '0' (length=1)          'region' => string '0' (length=1)          's' => string '1' (length=1)          'page' => string '1' (length=1)

更多PHP相关知识,请访问PHP中文网!

以上就是php解析url获取url中的参数值的详细内容,更多请关注求知技术网其它相关文章!

文章来源:智云一二三科技

文章标题:php解析url获取url中的参数值

文章地址:https://www.zhihuclub.com/3101.shtml

关于作者: 智云科技

热门文章

评论已关闭

1条评论

  1. Wow, incredible weblog format! How lengthy have you ever been running a blog for?

    you make blogging glance easy. The total look of ypur
    web site is excellent, as neatly as the content material![X-N-E-W-L-I-N-S-P-I-N-X]I just could not
    depart your site before suggesting that I extremely enjoyed the standard info a
    person supply in your guests? Is going to be back continuously to check up on new posts.

    my blog post: pro betting club platinum winners ()

网站地图