I am facing problem with json parse. I have this in php:
json_encode(getTeams(),JSON_HEX_APOS);
it return huge data.
Sample data: for more clarification lets say i have this:
my_encoded_data =
{
"13": "Germany-1",
"14": "Russia-1",
"15": "Switzerland-1",
"16": "Canada-1",
"17": "USA-1",
"18": "USA-2",
"19": "Germany-2",
"20": "Italy-1",
"21": "Switzerland-2",
"22": "Austria-1",
"23": "Italy-2",
"24": "Netherlands-1",
"25": "Poland-1",
"26": "Latvia-1",
"27": "Russia-2",
"28": "Czech Republic-1",
"29": "Great Britain-1",
"30": "France-1",
"31": "Canada-2",
"32": "Slovakia-1",
"43": "A. Florschütz/T. Wustlich",
"44": "P. Leitner/A. Resch",
"46": "G. Albrecht/E. Pothier",
"48": "C. Moffat/M. Moffat",
"50": "V. Boizov/D. Khamkin",
"51": "M. Kuzmitch/J. Veselov",
"53": "T. Schiegl/M. Schiegl",
"56": "P. Griffal/D. Joye",
"59": "A. Linger/W. Linger",
"62": "G. Plankensteiner/O. Haselrieder",
"65": "A. Sics/J. Sics",
"68": "C. Oberstolz/P. Gruber"
}
I have tested this data by spilt it into small parts to validate in jsonlint. it shows me valid json. then i have assigned it in javascript in:
window.objteamsFromServer = my_encoded_data;
Then i wanted to parse it in json like this:
arrSearch = window.objteamsFromServer;
It gives me this error:
JSON.parse: bad escaped character
how can i solve this?
let me know if any informations needed .
Thanks,
Awlad