Strip out www

7 posts by 3 authors in: Forums > CMS Builder
Last Post: December 16, 2010   (RSS)

Re: [sagentic] Strip out www

By Jason - December 16, 2010

Hi Kenny,

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

Hi Jason,

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

Hi Kenny,

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: [Jason] Strip out www

By zip222 - December 16, 2010

remove the $ in front of "echo"

Re: [zip222] Strip out www

By Jason - December 16, 2010

Good catch. Thanks!
---------------------------------------------------
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

That worked! Thanks!