/4.0/Testing/Tests/ext/web/parse_url.php

# · PHP · 22 lines · 19 code · 3 blank · 0 comment · 0 complexity · 8c600ede1f4b41c2cb9fe681f5d0ede9 MD5 · raw file

  1. [expect php]
  2. [file]
  3. <?php
  4. function test()
  5. {
  6. $urls = array(
  7. 'http://subdomain.host.com/path?',
  8. 'http://subdomain.host.com/path?#arg1=1&q=arg2.com',
  9. 'http://www.somehost.com//',
  10. 'http://www.somehost.com////',
  11. 'http:\\a.b.c\d\e\f?x');
  12. foreach($urls as $url)
  13. {
  14. $url_parts = parse_url($url);
  15. print_r($url_parts);
  16. }
  17. }
  18. test();
  19. ?>