
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,我们会在看到邮件的第一时间内为您处理!

键盘喵速排官网:一个专为微信公众号文章排版设计的在线编辑器
一款专业音频资源和音乐家社区免费商用平台—— Looperman
易购宝APP