Hi,
Here is a simple function which can be used to parse the URL.
parse_url is a built in php function which can be used to parse url and get the type of request like whether its http or https or ftp, gives the domain name like www.google.com and path and the query.
eg. consider this url - http://www.chaprak.com/articles.php?cat_id=6
In http://www.chaprak.com/articles.php?cat_id=6 this url if you execute parse_url function then it will show the following result.
scheme - http
url - www.chaprak.com
path - /articles.php
query - cat_id=6
url - www.chaprak.com
path - /articles.php
query - cat_id=6
For more information click here. Tweet this!