Strip out www
7 posts by 3 authors in: Forums > CMS Builder
Last Post: December 16, 2010 (RSS)
By Kenny - December 16, 2010
I want to echo the current domain, but make sure that any "http" or "www" is stripped out. I can get the "http" out, just not the "www" with this:
<?php $domain = $_SERVER['HTTP_HOST']; echo $domain; ?>
Any suggestions?
Kenny
Re: [sagentic] Strip out www
By Jason - December 16, 2010
Try this:
<?php $domain = str_replace("www.","",$_SERVER['HTTP_HOST']); ?>
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Strip out www
By Kenny - December 16, 2010
I tried that and it returns nothing.
I viewed the source of the output and nothing is there either.
Kenny
Re: [sagentic] Strip out www
By Jason - December 16, 2010 - edited: December 16, 2010
Did you add an echo statement?
<?php $domain = str_replace("www.","",$_SERVER['HTTP_HOST']);
echo $domain;
?>
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [zip222] Strip out www
By Jason - December 16, 2010
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/