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"};
?>
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment