<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 

 <html> 

  <head> 

   <title> parse_url.php </title> 

   <meta charset="UTF-8"> 

   <meta name="Author" content=""> 

   <meta name="Keywords" content=""> 

   <meta name="Description" content=""> 

  </head> 



  <body> 

   <?php 

 $ua=parse_url("http://jim@qq.com/patha/pathb?arg=va#aaa"); 

 var_dump($ua); 

   ?> 

  </body> 
</html>

 
array
  'scheme' => string 'http' (length=4)
  'host' => string 'qq.com' (length=6)
  'user' => string 'jim' (length=3)
  'path' => string '/patha/pathb' (length=12)
  'query' => string 'arg=va' (length=6)
  'fragment' => string 'aaa' (length=3)