php parse_url()函数

parse_url()函数是将输入的URL结构分解成几个部分来将其转变为一个关联数组

组成URL的几个基本部分为:scheme(协议名),host(主机名),port(端口号),path(文件路径),query(查询参数),user(用户名),pass(密码)如:http://www.example.com/index.php?week=1#demo

scheme:http

host:www.example.com

port:80

user:

pass:

path:view.php

query:week=1

fragment:#demo

当URL是http://username:password@www.example.com的形式时,user:username,pass:password

posted @ 2014-06-02 10:03  ShowJoy  阅读(626)  评论(0编辑  收藏  举报