Sunday, 18 August 2013

PHP replace quotes inside of quotes, but not quotes escaped

PHP replace quotes inside of quotes, but not quotes escaped

I'm looking for code in PHP to replace quotes (") inside quotes ("),
unless those quotes (") are escaped () e.g (\") in a string. The inside
quotes being replaced with "\\"".
So I would like the string "\"text"text"\"" to turn into
"\"text\\"text\\"\"".
Thank you to all who can help.

No comments:

Post a Comment