str_replace(array("\r", "\n", "\r\n", "\n\r"), '', $str);

$str就是你的原來字串,利用str_replace將所有可能的換行符號網且放到陣列裡,只要符合其中一組,就會換成'',這樣就清掉了.

arrow
arrow
    文章標籤
    php remove r n
    全站熱搜

    痞客興 發表在 痞客邦 留言(0) 人氣()