Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get domain from subdomain php

$host = $_SERVER['HTTP_HOST'];
preg_match("/[^./]+.[^./]+$/", $host, $matches);
echo "domain name is: {$matches[0]}
";
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #domain #subdomain #php
ADD COMMENT
Topic
Name
6+5 =