![](/img/trans.png)
[英]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.