使用PHP正則表達式替換換行符

使用PHP正則表達式替換換行符可以使用以下代碼:

$string = preg_replace('/\r\n|\r|\n/', '', $string);

到此為止。

發布者:彬彬筆記,轉載請註明出處:https://www.binbinbiji.com/zh-hant/php/3112.html

(0)
彬彬筆記彬彬筆記
上一篇 2023年4月3日
下一篇 2023年4月13日

相關推薦

發表回復

登錄後才能評論
蜀ICP備14017386號-13