PHP parse_url() Function

The parse_url() function is used to automatically split the URL into its constituent parts.

Demo :



Enter URL :  

Example :

Give URL like: http://www.tutorialsscripts.com:80/free-php-scripts/php-parse_url-function-demo.php?a=b

Following code is used to parse_url() function demo code If you need to copy and use your web site.


<?php
   $url = "http://www.tutorialsscripts.com:80/free-php-scripts/php-parse_url-function-demo.php?a=b";
   $data = parse_url($url);
   foreach ($data as $k=>$v)
   {
   echo "$k: $v \n";
   }
?>

The parse_url() function have in the one arguments that name is string url.The parse_url() function will split protocol, domain name, path, or other significant component from a URL.

Free Download Script :

If you need parse_url() function demo code download from following link.

Download




Content