1.需求
了解parse_url的使用方法
2.实例
$uri = parse_url('http://dummy'.$_SERVER['REQUEST_URI']);
var_dump($uri);
array (size=3)
'scheme' => string 'http' (length=4)
'host' => string 'dummy' (length=5)
'path' => string '/test.php' (length=9)
3.手册怎么说
用来分解url的,分成下面几段构造的数组
scheme - e.g. http
host
port
user
pass
path
query - after the question mark ?
fragment - after the hashmark #
参考资料:http://php.net/manual/en/function.parse-url.php