Domain Empire

[SNIPPET] Get Current Domain Name

Spaceship Spaceship
Watch
Impact
133
This is a snippet which will show the current domain name.

Posting this as I had a few requests by people

PHP:
<?php $pageUR1  = ereg_replace("/(.+)", "", $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
$curdomain  = str_replace("www.", "", $pageUR1); 
echo $curdomain;

:bingo:
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Also available...
PHP:
$_SERVER['HTTP_HOST'];

:)
 
0
•••
Bah all these smart people. :D
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back