note 105665 deleted from function.parse-url by danbrown
| From: | danbrown@php.net | Date: | Tue, 06 Sep 2011 15:32:23 +0000 |
| Subject: | note 105665 deleted from function.parse-url by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182972@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
Easy way to get domain name:
<?php
$parts = explode(".",$_SERVER['HTTP_HOST']);
$sub = $parts[0];
$domain = $parts[1];
$tld = $parts[3];
echo "http://".$sub.".".$domain.$tld."/";
?>