【发布时间】:2011-07-20 07:19:37
【问题描述】:
我正在尝试替换 php 中的某个单词并在其中包含一个空格。
这个字符串最终会被编码为 html 格式。但是,在以 html 格式编码后,   总是变成“换行符”而不是“一个标准空格”。我可以知道为什么会这样吗?谢谢
$storeAddr = preg_replace('/test/', "<br> test1", $storeAddr);
I.E
string: 1)xxxxtestxxxx
current output: 1)xxx
testxxxx
desired output: 1)xxx
testxxxx
【问题讨论】:
标签: php html preg-replace