JSON with \ x26 in values ​​breaks PHPs json_decode

https://www.googleapis.com/freebase/v1/search?query=madonna#

The JSON result breaks PHP json_decode. To be precise, the following line interrupts decoding: "Sticky \ x26amp; Sweet Tour".

Browsers seem to be able to figure this out: http://jsfiddle.net/nggX2/ and http://jsfiddle.net/QUVFt/

http://jsonlint.com/ claims to be invalid JSON.

On the PHP side, I tried: http://codepad.viper-7.com/suUbQD and <a5>

Any thoughts on what's going on?

+1
source share
2 answers

, , JSON. URL- - JSON escape- \xXX, \uXXXX escape- unicode. &, - escape-.

, google/freebase JSON.

+7

JSON :

"Sticky \\x26amp; SweetTour"

, escape char.

+1

All Articles