php detect domain name url code example
Example 1: php get domain name from url
parse_url('http://www.website.com/hey.php', PHP_URL_HOST);
Example 2: if browser url is having domain name in it check using php
$url = $_SERVER['SERVER_NAME'];
if (!strpos($url,'mysql')) {
echo 'No mysql.'; //swapped with other echo statement
} else {
echo 'Mysql exists.';
}