parsing domains

From: Date: Thu, 28 Aug 2003 08:30:44 +0000
Subject: parsing domains
Groups: php.general 
Request: Send a blank email to php-general+get-161011@lists.php.net to get a copy of this message
Quick question... I parse domains in my scripts like this to get the .domain.com out of www.domain.com. However, if someone visits my site with just domain.com in the url, I get .com back as the parsed domain. How can I make it so I aways get the .domain.com no matter what they use? Here is an example of what I use now... $parseddomain = preg_replace('/.+?(\..+)/', '$1', $domain); -- _______________________________________________ Get your free Verizonmail at www.verizonmail.com

« previous php.general (#161011) next »