
php语法如何利用str_replace和strip_tags去掉连续空格,下面web建站小编给大家详细介绍一下!
去除空格代码如下:
<?php
$note = strip_tags($value['Content']);
$note = trim($note);
$note = str_replace(" ","",$note);
$note = preg_replace('#\s+#', ' ',trim($note));
$note = str_replace("<","<",$note);
$note = str_replace(">",">",$note);
$note = preg_replace("/[ ]{1,}/isu"," ",$note);
echo getsubstr($note,100);
?>
标签: str_replace, strip_tags
上面是“php语法如何利用str_replace和strip_tags去掉连续空格”的全面内容,想了解更多关于 php入门 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_2656.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

MC-Bench:一款AI模型评测平台
HaiSnap官网:一个零代码AI开发平台,支持一键部署、源代码下载和社区共享等功能
js在指定时间加几个小时
韩国Naver网页版首页入口,附外网使用教程及网站基本介绍
360有钱联盟:为电脑技术员、网站站长、APP开发者等提供广告分发与收益共享服务
vue缓存组件的正确写法及基本介绍