$str = str_replace(array('/r/n', '/r', '/n'), $str);
$str = str_replace(array("/r/n", "/r", "/n"), $str);
//php 有三種方法來解決
//1、使用str_replace 來替換換行
$str = str_replace(array("\r\n", "\r", "\n"), "", $str);
//2、使用正則替換
$str = preg_replace('//s*/', '', $str);
//3、使用php定義好的變量 (建議使用)
$str = str_replace(PHP_EOL, '', $str);
如對(duì)本文有疑問,請(qǐng)?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會(huì)為你解答?。?點(diǎn)擊進(jìn)入論壇