[英]Remove All Kinds of Tabs, White Space, Carriage Return In A String in PHP
[英]Remove empty space and carriage return from a string with ] at end and [ at the start of the next line
我對正則表達式比較陌生。 我只是想知道如何通過php中的preg_replace
替換此字符串的空白或回車符(換行):
[someshortcode]
[someshortcode]
字符串在一行的末尾有]
,在新行中有[
。 我想刪除任何空格/字符,無論是'\\r'
, '\\t'
, '\\n'
,空格還是任何其他字符
輸出應該是這樣的: [someshortcode][someshortcode]
謝謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.