$foo_json = '{"hoge":"ywwxEu|`tYdBeARGJ?nJ~BHHmDjX|PdEl@Rj@\\XVtKtK\\VbKnFrIbEzEbBnEbBfDfAxBz@LJjBl@jEzAfZzKDPY|DUdCGbAFL?|AD~AJ\\LNPJ~B|@p@Ll@FRDd@RvBnAfA`@dAl@^NhAVd@@p@?h@H`@Pv@l@TR^f@`Rd@xAFdEVnCLjJn@Cn@FlRDh@HRHHjKpG\\\\jC`G|EvJ|BjGf@vAJh@nGpC`FrBbG`D~@XdBRnNtAnTdBf@Jn@Zf@h@pB`DrD|EZl@jBfEf@`Af@r@tCpChFrG~@zAx@dBdB~Cz@xA`AxA|@l@f@VdDrAnAl@jI~CpCv@|@f@~An@jIxD~CdAzAl@rCvAjI|CzJpClJbCvLdDbn@lH`d@pF~Df@dDn@hA`@hBfA~AbAzQpMvHhFhQ~L~G`FtBrArCnBbBnAjB`A`~@~^tBx@n@RfB\\b@Fh@B|BBpV{AfSgArJq@~@?dBF`Cd@nFjAhXdG~@VtMpEd[fKfL|DxWrI~Y`KvLtDp\\zK|DnAzBbAbA|@rAtApAfBhA`Cl@fBh@lBtEpQh@fBrAjFdDpLdArCj@fAd@x@`BvBlDnDrVxWjDzD`GlGhCvBvBvA|DjBlC|@hTvEfBNvABvISxUo@|JSlA@tBLt@LdAXv@ZnB~@~@t@xAnAf@f@xEdEzAbBzAnBlWp_@bAnBlBpE|@tChBdFhBjGzCnJrCdHp@jAxAxBlGvH~@|Ab@bAp@xBnCdMd@pBl@fBt@bB\\j@v@lAxUlUtCjCdBz@nJdIdJbIrH`H~F|EjDxCzAnBNb@HdAJ|Fb@jDTpHq@@"}';
$foo = json_decode($foo_json);
I wrote this code, but json_decode returns null, and json_last_error() returns "JSON_ERROR_SYNTAX". So I know there are some syntax errors, but I tried the string at JSONLint, they say Valid JSON.
Probably the reason why because the string is complicated and includes symbols. I do not understand what is wrong.
PHP5.6.33
CentOS release 6.6
The answer is here. The problem was backslashes, and I do not like to remove it. json_decode returns JSON_ERROR_SYNTAX but online formatter says the JSON is OK Above article says just remove it, in this case, I need to replace it.
$foo_json = str_replace('\\', '\\\\', $foo_json);
I added this code, then it works fine.