用preg_replace替换文本中指定的双引号


Replacing specified double quotes in text with preg_replace

我有一个序列化的数组,我需要替换所有位置的双引号,如下所示:

...s:30:"test "is" & test";...

...s:30:"test "is" & test";...

文本中可能有很多引号,所以有人能帮忙吗?

尝试

preg_replace("/([^:])('")([^;:])+/isU","$1"$3",$arr);