Passion of my life
Related to cooking, crafts, painting and travel
Thursday, January 10, 2013
PHP Snippets
How to get domain without www/subdomains
using php
<?php
$host = $_SERVER['HTTP_HOST'];
preg_match("/[^\.\/]+\.[^\.\/]+$/",$host,$matches);
echo "domain name is :{$matches[0]}\n"};
?>
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)