$test = parse_url("http://localhost/index.php?name=tank&sex=1#top"); print_r($test);
结果如下
Array ( [scheme] => http //使用什么协议 [host] => localhost //主机名 [path] => /index.php //路径 [query] => name=tank&sex=1 // 所传的参数 [fragment] => top //后面根的锚点 )
$test = parse_url("http://localhost/index.php?name=tank&sex=1#top"); print_r($test);
结果如下
Array ( [scheme] => http //使用什么协议 [host] => localhost //主机名 [path] => /index.php //路径 [query] => name=tank&sex=1 // 所传的参数 [fragment] => top //后面根的锚点 )