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

  

posted @ 2015-02-28 18:08  jshaibozhong  阅读(517)  评论(0编辑  收藏  举报