
PHP在不同的系統中,換行是不同的
Linux:\n
Windows:\r\n
mac:\r
是以去除回車換行的方法:
1.使用php定義好的變量(比較好的方法,推薦)
$str= str_replace(PHP_EOL, '', $str);
2.使用str_replace 來替換換行
$str= str_replace(array("\r\n", "\r", "\n"), "", $str);
如何聯系我:【萬裡虎】www.bravetiger.cn
【QQ】3396726884 (咨詢問題100元起,幫助解決問題500元起)
【部落格】http://www.cnblogs.com/kenshinobiy/