PHP scripts and programs for Beginner to Master

php programs, php ready to use scripts & functions, css tutorials, html, javascripts, ajax examples for Beginner to Master


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 and path and the query.

In this url if you execute parse_url function then it will show the following result.

scheme - http
url -
path - /articles.php
query - cat_id=6

For more information click here.

I'm reading: How to Extract Domain name from URL ?Tweet this!


Hey thanks a lot for sharing useful interview questions..... which will be very helpful while attending the interviews.....
glad i found ur site...really a very helpful site.....
by the way check out my collection of php interview questions from here: php interview questions

Thanks for another great post. It will surely improve our coding practice. Keep sharing similar stuff
cakephp development

Extracting domain name can make it more neat to other users. Thanks for sharing this tutorial to us. This really help us a lot!

Cris | PHP Developers

Thanks for share it. I got some important points which will help to me in future so thanks again.
Cake PHP Programmers

Post a Comment