Replacing specified double quotes in text with preg_replace
问题 I have got a serialized array, and I need to replace double quotes in all places like this: ...s:30:"test "is" & test";... to ...s:30:"test "is" & test";... There can be a lot of quotes in the text, so can somebody help with it? 回答1: Try preg_replace("/([^:])(\")([^;:])+/isU","$1"$3",$arr); 来源: https://stackoverflow.com/questions/12037289/replacing-specified-double-quotes-in-text-with-preg-replace