修剪 [英] trim
本文介绍了修剪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问题的基本分类
$ CurrentSite = $ _SERVER [" HTTP_HOST"];
<?php echo $ CurrentSite;?>
我只希望''domain.com''部分显示..即使主持人是
www.domain.com 或whatever.domain.com
我只是想显示domain.com,我是正确地认为定期的
表达式将是解决方案吗?
任何帮助都会节省我的理智。
谢谢
解决方案
CurrentSite =
_SERVER [" HTTP_HOST"];
<?php echo
CurrentSite;?>
我只想显示''domain.com''部分..即使主持人是 www.domain.com 或whatever.domain .com
我只是想显示domain.com,我是否认为定期
表达式是解决方案?
任何帮助都会节省我的理智。
谢谢
this may seem so lame to some, but I have exausted my brain trying to figure
this out, and therefore throw myself at the group:
basic breakdown of problem
$CurrentSite = $_SERVER["HTTP_HOST"];
<?php echo $CurrentSite ;?>
I only want the ''domain.com'' part to display.. even if the host is
www.domain.com or whatever.domain.com
I just want to display the domain.com, am I right in thinking that regular
expressions would be the solution?
any assistance would save my sanity.
Thanks
解决方案
CurrentSite =
_SERVER["HTTP_HOST"];
<?php echo
CurrentSite ;?>
I only want the ''domain.com'' part to display.. even if the host is
www.domain.com or whatever.domain.com
I just want to display the domain.com, am I right in thinking that regular
expressions would be the solution?
any assistance would save my sanity.
Thanks
这篇关于修剪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文