SyntaxFix
Write A Post
Hire A Developer
Questions
It took me like an hour to figure it out, but trailing commas (which work in JavaScript) fail in PHP. This is what fixed it for me:
str_replace([PHP_EOL, ",}"], ["", "}"], $JSON);