I like to print copyright www.example.com in my footer, is there a variable that will call the domain name? with or without www (doesn't matter).

I tried base_url but it gives a relative base url.

Thanx in advance.

Comments

Tomi’s picture

Something like this could work:

global $base_url;
$url_parts = parse_url($base_url);
print("© " . $url_parts['host']);

This extracts the host from base_url. For more info, see http://www.php.net/parse_url

JurriaanRoelofs’s picture

works perfectly! thanks.

ps I ended up changing it like this to get www in front of it:
removed, code not very reliable

-------------------------------
http://www.sooperthemes.com/#-Drupal-Themes

Michael M’s picture

You can use the $site_name variable in the theme if you set it to your site's domain name.

print $site_name;

----
http://PointHomes.com