Anton
Anton

Reputation: 1061

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?

Upvotes: 1

Views: 3457

Answers (1)

Touki
Touki

Reputation: 7525

Try

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

Upvotes: 3

Related Questions