“parse_url” function 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.example.com and path and the query.
eg. consider this url – “http://www.example.com/page.php?id=1”
In “http://www.example.com/page.php?id=1” this url if you execute parse_url function then it will show the following result.
Scheme - http
url - www.example.com
path - /page.php
query - id=1
No comments:
Post a Comment