PHP去除连续空格

<?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);
    ?>

  

原文地址:https://www.cnblogs.com/jthb/p/4306032.html