http://piratepad.net/IY48xXzsys (由 Peter West 修改,原文来自此处:http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/)
目前“I think, therefore”和“I think therefore”之间的差异会产生:
I < del >think,< /del >< ins >think< /ins > therefore
我希望它产生:
I think< del >,< /del > therefore
我认为答案是将逗号作为一个单独的实体包含在 preg_split
函数生成的数组中。我试着玩弄括号,但无法让它发挥作用。你能帮帮我吗?
最佳答案
我认为在调用 split
时在分隔符中添加一个逗号即可。
关于php - 标点符号的字符串差异 : is preg_split the answer?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6301893/