PHP parse_url函数

 <?php

 

  $url = 'http://username:password@hostname/path?arg=value#anchor';

 

  print_r(parse_url($url));

 

  ?>

 

  以上例程会输出:

 

  Array

 

  (

 

  [scheme] => http

 

  [host] => hostname

 

  [user] => username

 

  [pass] => password

 

  [path] => /path

 

  [query] => arg=value

 

  [fragment] => anchor

 

  )

你可能感兴趣的:(PHP,parse_url)