Naomi Naomi Naomi Naomi - 5 months ago 11x
PHP Question

php regex Remove "-s from string

I need to remove "-s that making invalid json, how do I do it in php regex?

"name": "Steak "au Four" ",

in this situation remove "au Four"-s " quotes


This is the php code to match the two quotes within a quote:

$re = "/^\"[^\"]*?(\")[^\"]*?(\")[^\"]*?\"$/"; 
$str = "\"Steak \"au Four\" \""; 

preg_match($re, $str, $matches);

Sample demo here