Please help me.
Here my json input.
{"id":"FWAX014","price":18,"quantity":1}
Expected output should be like this:
{id:"FWAX014",price:18,quantity:1}
Thanks in advance.
The following regex removes the double quotes you want:
(?<={|,)"(\w+)"
(?<={|,)
checks that the following pattern is preceded by a curly brace or a comma"(\w+)"
matches the word between the quotes$re = '/(?<={|,)"(\w+)"/';
$str = '{"id":"FWAX014","price":18,"quantity":1}';
$result = preg_replace($re, '$1', $str);