php get domain and subdomain from url code example
Example 1: php get domain name from url
parse_url('http://www.website.com/hey.php', PHP_URL_HOST);
Example 2: send data with url in php
// Send the variables myNumber=1 and myFruit="orange" to the new PHP page...
<a href="page2.php?myNumber=1&myFruit=orange">Next page</a>