Thread: php question
View Single Post
Old 07-26-2009, 03:50 AM  
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by cLin View Post
Code:
$domain_strip = preg_replace("/^(.*\.)?([^.]*\..*)$/", "$2", $_SERVER['HTTP_HOST']);
$domain = substr($domain_strip, 0, strpos($domain_strip, "."));
Grabs the domain name from website url. If that's what you want.
Erk.
Try:
Code:
echo parse_url($u,PHP_URL_HOST);
Where $u has your URL string.
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook