PHP解析URL是哪个函数?怎么用?

匿名网友 匿名网友 发布于: 2015-08-30 00:00:00
阅读 114 收藏 0 点赞 0 评论 0

parse_url() 是讲URL解析成有固定键值的数组的函数
$ua=parse_url(“http://username:password@hostname/path?arg=value#anchor”);
print_r($ua);
结果:

Array
(
[scheme] => http
[host] => hostname
[user] => username
[pass] => password
[path] => /path
[query] => arg=value
[fragment] => anchor
)

评论列表
文章目录