Json With \x26 In Values Breaks Phps Json_decode
https://www.googleapis.com/freebase/v1/search?query=madonna# The JSON result is breaking PHPs json_decode. To be exact, the following string is breaking decoding: 'Sticky \x26amp;
Solution 1:
What's going on is that this is invalid JSON. The response from that url is incorrect--JSON doesn't allow the \xXX
two-digit hexadecimal binary escape sequences, only \uXXXX
unicode code point escape sequences. Here it should just be &
, though--no escape sequence needed.
No idea why google/freebase is outputting invalid JSON.
Post a Comment for "Json With \x26 In Values Breaks Phps Json_decode"