Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试了很多东西,但没有任何反应。由于 ascii 字符 x02(在 VIM 中为 '^B'),我生成的 xml 格式不正确。我已经尝试过以下行:
$keywords = preg_replace('/\x02/', '', $keywords);
但这行不通。你有想法吗?
为什么使用正则表达式?
str_replace(chr(2),'',$keywords);
您必须"使用转义序列。将您的代码替换为:
"
$keywords = preg_replace("/\x02/", '', $keywords);