decode json format data sent via url - php

consider the following url
index.php?json={uid:guest|10001441}
I am not able to decode the data .
I need the output as {"uid":"guest|10001441"}.
The code i m using is
if (isset($_GET['json']))
{
$url_data = $_GET['json'];
$decoded_data = json_decode($url_data,true);
var_dump($decoded_data);
}
But it gives me output as NULL. What am i doing wrong?? Do i need to pass data in a different format??

It seems impossible to decode a JSON string without double quotes, as it's hard to determine whether a JSON string "{A:B:C}" is encoded from {"A":"B:C"} or from {"A:B":"C"}
You can use urlencode() to encode the JSON string or just ignore the extreme cases and add the double quotes manually to make the JSON string valid, hope this help :D

The data you're passing is not valid JSON. It doesn't have double quotes around it currently. Try this:
if (isset($_GET['json']))
{
$url_data = '"'.$_GET['json'].'"';
$decoded_data = json_decode($url_data,true);
var_dump($decoded_data);
}
Output:
string(20) "{uid:guest|10001441}"
Also, I'd suggest using POST instead of GET here.

If you pass it like this it will work: ?json={"uid":"guest|10001441"}
But I am not sure whether it is a proper method.

The JSON you have in your URL is not valid. PHP's json_decode looks for double quotes around the uid and it's value.
EDIT: Rather than storing the data in the URL as json could you not store the data as key value pairs such as
?uid=value
And then you could do something like
$data = json_encode( $_GET );

you can encode url parameter with base64_encode()
$json=base64_encode('{"uid":"guest|10001441"}');
url will look like this
index.php?json=eyJ1aWQiOiJndWVzdHwxMDAwMTQ0MSJ9
then do like this :-
if (isset($_GET['json']))
{
$url_data = base64_decode($_GET['json']);
$decoded_data = json_decode($url_data,true);
var_dump($decoded_data);
}

Related

Error converting Json string to array of objects PHP

I made a post in a form converting my javascript localstorage to a post request. From there I tried to decode my json string to make an object in PHP.
How my php code looks before I echo it
$cart_items = $_POST['cart_items'];
$cart_items = json_encode($cart_items);
$array_test = json_decode($cart_items);
print_r($array_test);
What it returns in browser
[{\"id\":83494890,\"title\":\"2020 Hino 358\",\"partType\":\"Bumpers\",\"price\":100,\"stockNumber\":12313131312,\"thumbImg\":\"/jOIY91KhEby8_f.jpg\",\"permalink\":\"/part-description/?part=83494890\",\"maxQuantity\":1,\"requestedQuantity\":\"3\"}
,{\"id\":83493833,\"title\":\"2009 Freightliner 5020080\",\"partType\":\"ABS Modulator Valves\",\"price\":150,\"stockNumber\":\"P-1211111111157\",\"thumbImg\":\"/OOjQbsi6p8kX_f.jpg\",\"permalink\":\"/part-description/?part=83493833\",\"maxQuantity\":1,\"requestedQuantity\":\"1\"}]
I know that typically when seeing json data there isn't forward slashes everywhere. I tried to json_decode into an array rather than an object, then make a foreach for each object inside. But I got this error returned "Invalid argument supplied for foreach()"
How do I make this json string convert to an array of objects? Thank you
The problem I was having was when I was getting the $_POST[] it was using PHP's "magic quotes" which was giving me improper format for my json. That being said, after disabling this, it removes the slashes.
It looks like $_POST['cart_items'] already contains JSON. So you just need to decode it, not encode it first.
$array_test = json_decode($_POST['cart_items'], true);
print_r($array_test);
But it's actually encoded twice, that's why it has escaped quotes, so you need to call json_decode() twice. But it's missing the double quotes around the whole thing, and the embedded newline is not valid.
The following works:
<?php
$cart_items = '"[{\"id\":83494890,\"title\":\"2020 Hino 358\",\"partType\":\"Bumpers\",\"price\":100,\"stockNumber\":12313131312,\"thumbImg\":\"/jOIY91KhEby8_f.jpg\",\"permalink\":\"/part-description/?part=83494890\",\"maxQuantity\":1,\"requestedQuantity\":\"3\"},{\"id\":83493833,\"title\":\"2009 Freightliner 5020080\",\"partType\":\"ABS Modulator Valves\",\"price\":150,\"stockNumber\":\"P-1211111111157\",\"thumbImg\":\"/OOjQbsi6p8kX_f.jpg\",\"permalink\":\"/part-description/?part=83493833\",\"maxQuantity\":1,\"requestedQuantity\":\"1\"}]"';
$array_test = json_decode(json_decode($cart_items));
print_r($array_test);
I suggest you find the code that's sending the cart_item POST parameter and fix it so it doesn't do all this extra encoding.

php: json_decode containing HTML fails to decode

I need to use a customer's API for loading JSON which only contains something like:
{"html" : "foo"}
The API is being used from other services so I'm pretty sure it's valid.
However, when trying to decode it using json_decode i'm always getting an empty string which means it's not valid. I found out i need to "fix" the JSON-String by replacing:
$json = str_replace("\\>", "\\\\>", $json); // \> = invalid json
It works mainly on each request but not on certain others but it's very tricky to debug and i can't imagine that replacing is the proper method.
How would i do it the easy way for converting the json string into a valid one?
thanks
Ok i could find out what's wrong:
The HTML contains backslashes in the closing tags, for example <br\>
You need to replace them like this:
$json = str_replace("\\>", "\\\\>", $json);
and json_decode will work

How to make a JSON String to JSON

"villageJson": "{\"newShopTraps\":[6,6,3,0,0,4,2,0,2],\"cooldowns\":[],\"last_league_shuffle\":1,\"decos\":[{\"data\":18000031,\"x\":2,\"y\":36},{\"data\":18000011,\"x\":4,\"y\":36},{\"data\":18000027,\"x\":6,\"y\":38},{\"data\":18000012,\"x\":6,\"y\":40},{\"data\":18000033,\"x\":6,\"y\":36}],\"edit_mode_shown\":true,\"buildings\":[{\"lvl\":7,\"data\":1000001,\"x\":20,\"y\":19},{\"lvl\":8,\"data\":1000004,\"x\":22,\"y\":33,\"res_timer\":0},{\"lvl\":5,\"data\":1000000,\"x\":9,\"y\":8},{\"lvl\":0,\"data\":1000015,\"x\":28,\"y\":5},{\"lvl\":3,\"data\":1000014,\"x\":20,\"y\":16},{\"lvl\":9,\"data\":1000008,\"x\":10,\"y\":23},{\"lvl\":0,\"data\":1000015,\"x\":34,\"y\":28},{\"lvl\":8,\"data\":1000002,\"x\":16,\"y\":33,\"res_timer\":120625},{\"lvl\":10,\"data\":1000003,\"x\":21,\"y\":12},{\"lvl\":10,\"data\":1000005,\"x\":13,\"y\":20},{\"lvl\":9,\"data\":1000006,\"x\":34,\"y\":15},{\"lvl\":9,\"data\":1000008,\"x\":10,\"y\":14},{\"lvl\":9,\"data\":1000009,\"x\":15,\"y\":9},{\"lvl\":6,\"data\":1000010,\"x\":25,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":18,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":25,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":18,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":32},{\"lvl\":7,\"data\":1000010,\"x\":5,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":5,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":6,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":8,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":9,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":10,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":11,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":12,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":25},{\"lvl\":5,\"data\":1000000,\"x\":29,\"y\":28},{\"lvl\":5,\"data\":1000013,\"x\":13,\"y\":23},{\"lvl\":5,\"data\":1000007,\"x\":29,\"y\":33},{\"lvl\":10,\"data\":1000005,\"x\":27,\"y\":16},{\"lvl\":10,\"data\":1000003,\"x\":27,\"y\":24},{\"lvl\":9,\"data\":1000009,\"x\":27,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":27},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":28},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":29},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":30},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":31},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":34,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":35,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":18},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":32},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":33},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":34},{\"lvl\":8,\"data\":1000002,\"x\":19,\"y\":33,\"res_timer\":120624},{\"lvl\":9,\"data\":1000006,\"x\":34,\"y\":18},{\"lvl\":9,\"data\":1000006,\"x\":34,\"y\":21},{\"lvl\":8,\"data\":1000002,\"x\":11,\"y\":5,\"res_timer\":120160},{\"lvl\":8,\"data\":1000002,\"x\":25,\"y\":33,\"res_timer\":120716},{\"lvl\":8,\"data\":1000004,\"x\":21,\"y\":5,\"res_timer\":0},{\"lvl\":8,\"data\":1000004,\"x\":15,\"y\":5,\"res_timer\":0},{\"lvl\":8,\"data\":1000004,\"x\":10,\"y\":17,\"res_timer\":120216},{\"lvl\":5,\"data\":1000000,\"x\":8,\"y\":27},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":35},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":17},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":35,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":34,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":12},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":29,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":28,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":11},{\"lvl\":7,\"data\":1000010,\"x\":14,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":15,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":10},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":9},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":8},{\"lvl\":9,\"data\":1000008,\"x\":24,\"y\":9},{\"lvl\":9,\"data\":1000009,\"x\":14,\"y\":26},{\"lvl\":5,\"data\":1000012,\"x\":13,\"y\":15},{\"lvl\":8,\"data\":1000002,\"x\":24,\"y\":5,\"res_timer\":120218},{\"lvl\":8,\"data\":1000004,\"x\":30,\"y\":13,\"res_timer\":120687},{\"lvl\":5,\"data\":1000011,\"x\":16,\"y\":12},{\"lvl\":2,\"data\":1000020,\"x\":6,\"y\":17},{\"lvl\":8,\"data\":1000004,\"x\":14,\"y\":29,\"res_timer\":120626},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":7},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":6},{\"lvl\":7,\"data\":1000010,\"x\":17,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":18,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":5},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":25,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":18,\"y\":4},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":4},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":25,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":36},{\"lvl\":5,\"data\":1000013,\"x\":24,\"y\":12},{\"lvl\":5,\"data\":1000011,\"x\":27,\"y\":21},{\"lvl\":0,\"data\":1000015,\"x\":11,\"y\":32},{\"lvl\":8,\"data\":1000002,\"x\":18,\"y\":5,\"res_timer\":120217},{\"lvl\":5,\"data\":1000000,\"x\":28,\"y\":7},{\"lvl\":9,\"data\":1000006,\"x\":34,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":4},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":35},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":34},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":33},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":32},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":31},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":30},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":29},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":5},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":6},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":7},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":9},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":10},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":11},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":13,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":12,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":29,\"y\":27},{\"lvl\":7,\"data\":1000010,\"x\":17,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":10,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":18},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":17,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":18,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":25,\"y\":15},{\"lvl\":9,\"data\":1000008,\"x\":30,\"y\":24},{\"lvl\":9,\"data\":1000008,\"x\":25,\"y\":29},{\"lvl\":9,\"data\":1000009,\"x\":17,\"y\":22},{\"lvl\":5,\"data\":1000013,\"x\":30,\"y\":16},{\"lvl\":2,\"data\":1000023,\"x\":10,\"y\":20,\"res_timer\":40689},{\"lvl\":5,\"data\":1000012,\"x\":30,\"y\":20},{\"lvl\":3,\"data\":1000024,\"x\":17,\"y\":16},{\"lvl\":3,\"data\":1000026,\"x\":6,\"y\":20},{\"lvl\":0,\"data\":1000022,\"x\":17,\"y\":19},{\"lvl\":2,\"data\":1000028,\"x\":24,\"y\":23},{\"lvl\":0,\"data\":1000015,\"x\":7,\"y\":11},{\"lvl\":10,\"data\":1000005,\"x\":23,\"y\":26},{\"lvl\":10,\"data\":1000003,\"x\":17,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":6,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":8,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":17},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":23},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":13,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":13,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":12},{\"lvl\":7,\"data\":1000010,\"x\":25,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":18,\"y\":25},{\"lvl\":9,\"data\":1000009,\"x\":23,\"y\":16},{\"lvl\":5,\"data\":1000013,\"x\":18,\"y\":29},{\"lvl\":5,\"data\":1000012,\"x\":21,\"y\":29},{\"lvl\":5,\"data\":1000011,\"x\":20,\"y\":26},{\"lvl\":2,\"data\":1000023,\"x\":20,\"y\":9,\"res_timer\":40691},{\"lvl\":3,\"data\":1000026,\"x\":6,\"y\":23},{\"lvl\":1,\"data\":1000029,\"x\":6,\"y\":14}],\"obstacles\":[],\"last_news_seen\":155,\"last_league_rank\":13,\"newShopBuildings\":[4,0,6,3,6,3,4,1,5,5,225,3,3,4,1,5,0,0,0,3,1,0,1,2,1,0,2,0,1,1],\"newShopDecos\":[1,4,0,1,1,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}",
"warVillage": "{\"newShopTraps\":[6,6,3,0,0,4,2,0,2],\"cooldowns\":[],\"last_league_shuffle\":1,\"decos\":[{\"data\":18000031,\"x\":2,\"y\":36},{\"data\":18000011,\"x\":4,\"y\":36},{\"data\":18000027,\"x\":6,\"y\":38},{\"data\":18000012,\"x\":6,\"y\":40},{\"data\":18000033,\"x\":6,\"y\":36}],\"edit_mode_shown\":true,\"buildings\":[{\"lvl\":7,\"data\":1000001,\"x\":20,\"y\":20},{\"lvl\":8,\"data\":1000004,\"x\":11,\"y\":34,\"res_timer\":0},{\"lvl\":5,\"data\":1000000,\"x\":10,\"y\":28},{\"lvl\":0,\"data\":1000015,\"x\":8,\"y\":30},{\"lvl\":3,\"data\":1000014,\"x\":25,\"y\":21},{\"lvl\":9,\"data\":1000008,\"x\":24,\"y\":29},{\"lvl\":0,\"data\":1000015,\"x\":37,\"y\":16},{\"lvl\":8,\"data\":1000002,\"x\":34,\"y\":13,\"res_timer\":120625},{\"lvl\":10,\"data\":1000003,\"x\":12,\"y\":24},{\"lvl\":10,\"data\":1000005,\"x\":16,\"y\":27},{\"lvl\":9,\"data\":1000006,\"x\":11,\"y\":5},{\"lvl\":9,\"data\":1000008,\"x\":18,\"y\":33},{\"lvl\":9,\"data\":1000009,\"x\":20,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":29},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":30},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":31},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":33},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":34},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":35},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":35},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":18,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":25,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":35},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":35},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":34},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":33},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":32},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":31},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":30},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":29},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":29},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":30},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":31},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":29},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":31},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":30},{\"lvl\":5,\"data\":1000000,\"x\":11,\"y\":10},{\"lvl\":5,\"data\":1000013,\"x\":20,\"y\":29},{\"lvl\":5,\"data\":1000007,\"x\":7,\"y\":6},{\"lvl\":10,\"data\":1000005,\"x\":17,\"y\":12},{\"lvl\":10,\"data\":1000003,\"x\":27,\"y\":25},{\"lvl\":9,\"data\":1000009,\"x\":16,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":27},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":8,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":8,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":9,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":25,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":28,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":29,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":34,\"y\":28},{\"lvl\":7,\"data\":1000010,\"x\":10,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":11,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":12,\"y\":15},{\"lvl\":8,\"data\":1000002,\"x\":5,\"y\":27,\"res_timer\":120624},{\"lvl\":9,\"data\":1000006,\"x\":5,\"y\":12},{\"lvl\":9,\"data\":1000006,\"x\":4,\"y\":17},{\"lvl\":8,\"data\":1000002,\"x\":23,\"y\":37,\"res_timer\":120160},{\"lvl\":8,\"data\":1000002,\"x\":35,\"y\":29,\"res_timer\":120716},{\"lvl\":8,\"data\":1000004,\"x\":18,\"y\":37,\"res_timer\":0},{\"lvl\":8,\"data\":1000004,\"x\":28,\"y\":36,\"res_timer\":0},{\"lvl\":8,\"data\":1000004,\"x\":24,\"y\":32,\"res_timer\":120216},{\"lvl\":5,\"data\":1000000,\"x\":29,\"y\":11},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":35,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":35,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":14,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":17},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":35,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":34,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":15,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":29,\"y\":16},{\"lvl\":9,\"data\":1000008,\"x\":22,\"y\":8},{\"lvl\":9,\"data\":1000009,\"x\":10,\"y\":16},{\"lvl\":5,\"data\":1000012,\"x\":24,\"y\":25},{\"lvl\":8,\"data\":1000002,\"x\":21,\"y\":33,\"res_timer\":120218},{\"lvl\":8,\"data\":1000004,\"x\":8,\"y\":22,\"res_timer\":120687},{\"lvl\":5,\"data\":1000011,\"x\":16,\"y\":30},{\"lvl\":2,\"data\":1000020,\"x\":37,\"y\":19},{\"lvl\":8,\"data\":1000004,\"x\":32,\"y\":25,\"res_timer\":120626},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":17},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":12},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":11},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":10},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":29,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":11},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":11},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":11},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":11},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":9},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":8},{\"lvl\":7,\"data\":1000010,\"x\":17,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":11},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":12},{\"lvl\":7,\"data\":1000010,\"x\":17,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":18,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":7},{\"lvl\":5,\"data\":1000013,\"x\":29,\"y\":21},{\"lvl\":5,\"data\":1000011,\"x\":17,\"y\":9},{\"lvl\":0,\"data\":1000015,\"x\":8,\"y\":11},{\"lvl\":8,\"data\":1000002,\"x\":33,\"y\":20,\"res_timer\":120217},{\"lvl\":5,\"data\":1000000,\"x\":28,\"y\":29},{\"lvl\":9,\"data\":1000006,\"x\":4,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":7},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":25,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":8},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":17},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":9},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":18,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":10},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":11},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":12},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":23},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":25,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":19},{\"lvl\":9,\"data\":1000008,\"x\":33,\"y\":17},{\"lvl\":9,\"data\":1000008,\"x\":8,\"y\":19},{\"lvl\":9,\"data\":1000009,\"x\":21,\"y\":16},{\"lvl\":5,\"data\":1000013,\"x\":12,\"y\":20},{\"lvl\":2,\"data\":1000023,\"x\":37,\"y\":24,\"res_timer\":40689},{\"lvl\":5,\"data\":1000012,\"x\":16,\"y\":24},{\"lvl\":3,\"data\":1000024,\"x\":25,\"y\":18},{\"lvl\":3,\"data\":1000026,\"x\":20,\"y\":4},{\"lvl\":0,\"data\":1000022,\"x\":25,\"y\":15},{\"lvl\":2,\"data\":1000028,\"x\":16,\"y\":17},{\"lvl\":0,\"data\":1000015,\"x\":16,\"y\":37},{\"lvl\":10,\"data\":1000005,\"x\":25,\"y\":12},{\"lvl\":10,\"data\":1000003,\"x\":13,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":13,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":12,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":10,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":27},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":8,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":8,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":29,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":13,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":12,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":12,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":11,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":23},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":19},{\"lvl\":9,\"data\":1000009,\"x\":29,\"y\":17},{\"lvl\":5,\"data\":1000013,\"x\":21,\"y\":12},{\"lvl\":5,\"data\":1000012,\"x\":18,\"y\":16},{\"lvl\":5,\"data\":1000011,\"x\":25,\"y\":9},{\"lvl\":2,\"data\":1000023,\"x\":29,\"y\":7,\"res_timer\":40691},{\"lvl\":3,\"data\":1000026,\"x\":15,\"y\":4},{\"lvl\":1,\"data\":1000029,\"x\":25,\"y\":4}],\"obstacles\":[],\"last_news_seen\":155,\"last_league_rank\":13,\"newShopBuildings\":[4,0,6,3,6,3,4,1,5,5,225,3,3,4,1,5,0,0,0,3,1,0,1,2,1,0,2,0,1,1],\"newShopDecos\":[1,4,0,1,1,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}"
}
That's the JSON file and whenever I try to retrieve the data by doing the following:
$randomVar = $data['villageJson']['buildings'];
It returns an error saying 'buildings' is ... offset.
So what I did is what you guys probably know is I googled why it was doing that by doing a JSON Beautifier search and what showed was an error message saying that it was not a json. Which made me scratch my head for a bit and when I remove the double quotes encapsulating the entire 'villageJson' content it now said "Strings should be wrapped in double quotes". So I came into a conclusion that this is a json string and I have to turn it into a JSON before I could call any array.
So now for the question. How do I turn this JSON String to a JSON? I had an alternative in mind by just using a search function in php and I would get my value that way but that's only if I can't get any answers here.
THanks in advanced!
$str = '{"villageJson": "{\"newShopTraps\":[6,6,3,0,0,4,2,0,2],\"cooldowns\":[],\"last_league_shuffle\":1,\"decos\":[{\"data\":18000031,\"x\":2,\"y\":36},{\"data\":18000011,\"x\":4,\"y\":36},{\"data\":18000027,\"x\":6,\"y\":38},{\"data\":18000012,\"x\":6,\"y\":40},{\"data\":18000033,\"x\":6,\"y\":36}],\"edit_mode_shown\":true,\"buildings\":[{\"lvl\":7,\"data\":1000001,\"x\":20,\"y\":19},{\"lvl\":8,\"data\":1000004,\"x\":22,\"y\":33,\"res_timer\":0},{\"lvl\":5,\"data\":1000000,\"x\":9,\"y\":8},{\"lvl\":0,\"data\":1000015,\"x\":28,\"y\":5},{\"lvl\":3,\"data\":1000014,\"x\":20,\"y\":16},{\"lvl\":9,\"data\":1000008,\"x\":10,\"y\":23},{\"lvl\":0,\"data\":1000015,\"x\":34,\"y\":28},{\"lvl\":8,\"data\":1000002,\"x\":16,\"y\":33,\"res_timer\":120625},{\"lvl\":10,\"data\":1000003,\"x\":21,\"y\":12},{\"lvl\":10,\"data\":1000005,\"x\":13,\"y\":20},{\"lvl\":9,\"data\":1000006,\"x\":34,\"y\":15},{\"lvl\":9,\"data\":1000008,\"x\":10,\"y\":14},{\"lvl\":9,\"data\":1000009,\"x\":15,\"y\":9},{\"lvl\":6,\"data\":1000010,\"x\":25,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":18,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":25,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":18,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":32},{\"lvl\":7,\"data\":1000010,\"x\":5,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":5,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":6,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":8,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":9,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":10,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":11,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":12,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":25},{\"lvl\":5,\"data\":1000000,\"x\":29,\"y\":28},{\"lvl\":5,\"data\":1000013,\"x\":13,\"y\":23},{\"lvl\":5,\"data\":1000007,\"x\":29,\"y\":33},{\"lvl\":10,\"data\":1000005,\"x\":27,\"y\":16},{\"lvl\":10,\"data\":1000003,\"x\":27,\"y\":24},{\"lvl\":9,\"data\":1000009,\"x\":27,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":27},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":28},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":29},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":30},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":31},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":34,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":35,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":18},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":32},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":33},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":34},{\"lvl\":8,\"data\":1000002,\"x\":19,\"y\":33,\"res_timer\":120624},{\"lvl\":9,\"data\":1000006,\"x\":34,\"y\":18},{\"lvl\":9,\"data\":1000006,\"x\":34,\"y\":21},{\"lvl\":8,\"data\":1000002,\"x\":11,\"y\":5,\"res_timer\":120160},{\"lvl\":8,\"data\":1000002,\"x\":25,\"y\":33,\"res_timer\":120716},{\"lvl\":8,\"data\":1000004,\"x\":21,\"y\":5,\"res_timer\":0},{\"lvl\":8,\"data\":1000004,\"x\":15,\"y\":5,\"res_timer\":0},{\"lvl\":8,\"data\":1000004,\"x\":10,\"y\":17,\"res_timer\":120216},{\"lvl\":5,\"data\":1000000,\"x\":8,\"y\":27},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":35},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":17},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":37,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":35,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":34,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":12},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":29,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":28,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":11},{\"lvl\":7,\"data\":1000010,\"x\":14,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":15,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":10},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":9},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":8},{\"lvl\":9,\"data\":1000008,\"x\":24,\"y\":9},{\"lvl\":9,\"data\":1000009,\"x\":14,\"y\":26},{\"lvl\":5,\"data\":1000012,\"x\":13,\"y\":15},{\"lvl\":8,\"data\":1000002,\"x\":24,\"y\":5,\"res_timer\":120218},{\"lvl\":8,\"data\":1000004,\"x\":30,\"y\":13,\"res_timer\":120687},{\"lvl\":5,\"data\":1000011,\"x\":16,\"y\":12},{\"lvl\":2,\"data\":1000020,\"x\":6,\"y\":17},{\"lvl\":8,\"data\":1000004,\"x\":14,\"y\":29,\"res_timer\":120626},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":7},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":6},{\"lvl\":7,\"data\":1000010,\"x\":17,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":18,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":5},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":25,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":18,\"y\":4},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":4},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":25,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":36},{\"lvl\":5,\"data\":1000013,\"x\":24,\"y\":12},{\"lvl\":5,\"data\":1000011,\"x\":27,\"y\":21},{\"lvl\":0,\"data\":1000015,\"x\":11,\"y\":32},{\"lvl\":8,\"data\":1000002,\"x\":18,\"y\":5,\"res_timer\":120217},{\"lvl\":5,\"data\":1000000,\"x\":28,\"y\":7},{\"lvl\":9,\"data\":1000006,\"x\":34,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":4},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":35},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":34},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":33},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":32},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":31},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":30},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":29},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":4},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":5},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":6},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":7},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":9},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":10},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":11},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":13,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":12,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":29,\"y\":27},{\"lvl\":7,\"data\":1000010,\"x\":17,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":10,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":18},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":17,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":18,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":25,\"y\":15},{\"lvl\":9,\"data\":1000008,\"x\":30,\"y\":24},{\"lvl\":9,\"data\":1000008,\"x\":25,\"y\":29},{\"lvl\":9,\"data\":1000009,\"x\":17,\"y\":22},{\"lvl\":5,\"data\":1000013,\"x\":30,\"y\":16},{\"lvl\":2,\"data\":1000023,\"x\":10,\"y\":20,\"res_timer\":40689},{\"lvl\":5,\"data\":1000012,\"x\":30,\"y\":20},{\"lvl\":3,\"data\":1000024,\"x\":17,\"y\":16},{\"lvl\":3,\"data\":1000026,\"x\":6,\"y\":20},{\"lvl\":0,\"data\":1000022,\"x\":17,\"y\":19},{\"lvl\":2,\"data\":1000028,\"x\":24,\"y\":23},{\"lvl\":0,\"data\":1000015,\"x\":7,\"y\":11},{\"lvl\":10,\"data\":1000005,\"x\":23,\"y\":26},{\"lvl\":10,\"data\":1000003,\"x\":17,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":5,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":6,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":8,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":17},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":23},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":13,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":13,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":12},{\"lvl\":7,\"data\":1000010,\"x\":25,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":18,\"y\":25},{\"lvl\":9,\"data\":1000009,\"x\":23,\"y\":16},{\"lvl\":5,\"data\":1000013,\"x\":18,\"y\":29},{\"lvl\":5,\"data\":1000012,\"x\":21,\"y\":29},{\"lvl\":5,\"data\":1000011,\"x\":20,\"y\":26},{\"lvl\":2,\"data\":1000023,\"x\":20,\"y\":9,\"res_timer\":40691},{\"lvl\":3,\"data\":1000026,\"x\":6,\"y\":23},{\"lvl\":1,\"data\":1000029,\"x\":6,\"y\":14}],\"obstacles\":[],\"last_news_seen\":155,\"last_league_rank\":13,\"newShopBuildings\":[4,0,6,3,6,3,4,1,5,5,225,3,3,4,1,5,0,0,0,3,1,0,1,2,1,0,2,0,1,1],\"newShopDecos\":[1,4,0,1,1,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}","warVillage": "{\"newShopTraps\":[6,6,3,0,0,4,2,0,2],\"cooldowns\":[],\"last_league_shuffle\":1,\"decos\":[{\"data\":18000031,\"x\":2,\"y\":36},{\"data\":18000011,\"x\":4,\"y\":36},{\"data\":18000027,\"x\":6,\"y\":38},{\"data\":18000012,\"x\":6,\"y\":40},{\"data\":18000033,\"x\":6,\"y\":36}],\"edit_mode_shown\":true,\"buildings\":[{\"lvl\":7,\"data\":1000001,\"x\":20,\"y\":20},{\"lvl\":8,\"data\":1000004,\"x\":11,\"y\":34,\"res_timer\":0},{\"lvl\":5,\"data\":1000000,\"x\":10,\"y\":28},{\"lvl\":0,\"data\":1000015,\"x\":8,\"y\":30},{\"lvl\":3,\"data\":1000014,\"x\":25,\"y\":21},{\"lvl\":9,\"data\":1000008,\"x\":24,\"y\":29},{\"lvl\":0,\"data\":1000015,\"x\":37,\"y\":16},{\"lvl\":8,\"data\":1000002,\"x\":34,\"y\":13,\"res_timer\":120625},{\"lvl\":10,\"data\":1000003,\"x\":12,\"y\":24},{\"lvl\":10,\"data\":1000005,\"x\":16,\"y\":27},{\"lvl\":9,\"data\":1000006,\"x\":11,\"y\":5},{\"lvl\":9,\"data\":1000008,\"x\":18,\"y\":33},{\"lvl\":9,\"data\":1000009,\"x\":20,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":29},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":30},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":31},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":33},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":34},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":35},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":35},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":18,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":25,\"y\":36},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":36},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":35},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":35},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":34},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":33},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":32},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":31},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":30},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":29},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":29},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":30},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":31},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":32},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":29},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":31},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":30},{\"lvl\":5,\"data\":1000000,\"x\":11,\"y\":10},{\"lvl\":5,\"data\":1000013,\"x\":20,\"y\":29},{\"lvl\":5,\"data\":1000007,\"x\":7,\"y\":6},{\"lvl\":10,\"data\":1000005,\"x\":17,\"y\":12},{\"lvl\":10,\"data\":1000003,\"x\":27,\"y\":25},{\"lvl\":9,\"data\":1000009,\"x\":16,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":27},{\"lvl\":7,\"data\":1000010,\"x\":7,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":8,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":8,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":9,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":25,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":26,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":27,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":28,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":29,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":34,\"y\":28},{\"lvl\":7,\"data\":1000010,\"x\":10,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":11,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":12,\"y\":15},{\"lvl\":8,\"data\":1000002,\"x\":5,\"y\":27,\"res_timer\":120624},{\"lvl\":9,\"data\":1000006,\"x\":5,\"y\":12},{\"lvl\":9,\"data\":1000006,\"x\":4,\"y\":17},{\"lvl\":8,\"data\":1000002,\"x\":23,\"y\":37,\"res_timer\":120160},{\"lvl\":8,\"data\":1000002,\"x\":35,\"y\":29,\"res_timer\":120716},{\"lvl\":8,\"data\":1000004,\"x\":18,\"y\":37,\"res_timer\":0},{\"lvl\":8,\"data\":1000004,\"x\":28,\"y\":36,\"res_timer\":0},{\"lvl\":8,\"data\":1000004,\"x\":24,\"y\":32,\"res_timer\":120216},{\"lvl\":5,\"data\":1000000,\"x\":29,\"y\":11},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":35,\"y\":28},{\"lvl\":6,\"data\":1000010,\"x\":35,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":14,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":17},{\"lvl\":6,\"data\":1000010,\"x\":36,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":35,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":34,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":15,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":29,\"y\":16},{\"lvl\":9,\"data\":1000008,\"x\":22,\"y\":8},{\"lvl\":9,\"data\":1000009,\"x\":10,\"y\":16},{\"lvl\":5,\"data\":1000012,\"x\":24,\"y\":25},{\"lvl\":8,\"data\":1000002,\"x\":21,\"y\":33,\"res_timer\":120218},{\"lvl\":8,\"data\":1000004,\"x\":8,\"y\":22,\"res_timer\":120687},{\"lvl\":5,\"data\":1000011,\"x\":16,\"y\":30},{\"lvl\":2,\"data\":1000020,\"x\":37,\"y\":19},{\"lvl\":8,\"data\":1000004,\"x\":32,\"y\":25,\"res_timer\":120626},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":17},{\"lvl\":6,\"data\":1000010,\"x\":33,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":12},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":11},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":10},{\"lvl\":6,\"data\":1000010,\"x\":32,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":31,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":30,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":29,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":13},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":12},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":11},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":11},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":11},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":11},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":9},{\"lvl\":7,\"data\":1000010,\"x\":16,\"y\":8},{\"lvl\":7,\"data\":1000010,\"x\":17,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":11},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":12},{\"lvl\":7,\"data\":1000010,\"x\":17,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":18,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":7},{\"lvl\":5,\"data\":1000013,\"x\":29,\"y\":21},{\"lvl\":5,\"data\":1000011,\"x\":17,\"y\":9},{\"lvl\":0,\"data\":1000015,\"x\":8,\"y\":11},{\"lvl\":8,\"data\":1000002,\"x\":33,\"y\":20,\"res_timer\":120217},{\"lvl\":5,\"data\":1000000,\"x\":28,\"y\":29},{\"lvl\":9,\"data\":1000006,\"x\":4,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":7},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":25,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":7},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":8},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":8},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":17},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":24,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":23,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":22,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":9},{\"lvl\":6,\"data\":1000010,\"x\":21,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":20,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":19,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":18,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":15},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":10},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":11},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":12},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":13},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":14},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":15},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":16},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":17},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":18},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":23},{\"lvl\":7,\"data\":1000010,\"x\":28,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":27,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":26,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":25,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":26},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":19},{\"lvl\":9,\"data\":1000008,\"x\":33,\"y\":17},{\"lvl\":9,\"data\":1000008,\"x\":8,\"y\":19},{\"lvl\":9,\"data\":1000009,\"x\":21,\"y\":16},{\"lvl\":5,\"data\":1000013,\"x\":12,\"y\":20},{\"lvl\":2,\"data\":1000023,\"x\":37,\"y\":24,\"res_timer\":40689},{\"lvl\":5,\"data\":1000012,\"x\":16,\"y\":24},{\"lvl\":3,\"data\":1000024,\"x\":25,\"y\":18},{\"lvl\":3,\"data\":1000026,\"x\":20,\"y\":4},{\"lvl\":0,\"data\":1000022,\"x\":25,\"y\":15},{\"lvl\":2,\"data\":1000028,\"x\":16,\"y\":17},{\"lvl\":0,\"data\":1000015,\"x\":16,\"y\":37},{\"lvl\":10,\"data\":1000005,\"x\":25,\"y\":12},{\"lvl\":10,\"data\":1000003,\"x\":13,\"y\":16},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":13,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":12,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":10,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":9,\"y\":27},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":8,\"y\":27},{\"lvl\":6,\"data\":1000010,\"x\":8,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":26},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":29,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":13,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":12,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":17,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":16,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":15,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":14,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":24,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":23,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":22,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":21,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":13,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":12,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":11,\"y\":19},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":20},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":21},{\"lvl\":6,\"data\":1000010,\"x\":11,\"y\":22},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":25},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":24},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":23},{\"lvl\":6,\"data\":1000010,\"x\":7,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":25},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":24},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":23},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":22},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":21},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":20},{\"lvl\":7,\"data\":1000010,\"x\":19,\"y\":19},{\"lvl\":7,\"data\":1000010,\"x\":20,\"y\":19},{\"lvl\":9,\"data\":1000009,\"x\":29,\"y\":17},{\"lvl\":5,\"data\":1000013,\"x\":21,\"y\":12},{\"lvl\":5,\"data\":1000012,\"x\":18,\"y\":16},{\"lvl\":5,\"data\":1000011,\"x\":25,\"y\":9},{\"lvl\":2,\"data\":1000023,\"x\":29,\"y\":7,\"res_timer\":40691},{\"lvl\":3,\"data\":1000026,\"x\":15,\"y\":4},{\"lvl\":1,\"data\":1000029,\"x\":25,\"y\":4}],\"obstacles\":[],\"last_news_seen\":155,\"last_league_rank\":13,\"newShopBuildings\":[4,0,6,3,6,3,4,1,5,5,225,3,3,4,1,5,0,0,0,3,1,0,1,2,1,0,2,0,1,1],\"newShopDecos\":[1,4,0,1,1,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}"}';
$data = json_decode($str,1);
$village = json_decode($data['villageJson'],1);
$randomVar = $village['buildings'];
print_r($randomVar);
You should use json_decode() to turn the string into an object.
PHP: json_decode - Manual

How to recieve a json encoded string POSTED and extract them into variables php

how will I accept a json data
{
"ccToken": "75676576765",
"cardType": "CC",
}
which will be posted in my url and store the values in variables,like
$ccToken="756765676765"
cardType="CC"
I may sound dump..Im just new to this,so I dont know how I will accept a json string posted on a url..Usually if its variables,I can accept it like,
$ccToken = $_POST['ccToken'];
but for this thing.
and how will be able to sent a response like..200 in return?
Assuming your entire POST body is a JSON string, you'll need to pull in and decode the entire JSON from the body:
$raw_post_body = file_get_contents('php://input');
$data_object = json_decode($raw_post_body);
Then you can access the json decoded $data_object like:
echo $data_object->ccToken;
use the javascript JSON.stringify() method
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
and the php json_decode() function
http://uk3.php.net/json_decode

Do i need to apply htmlspecialchars / htmlentites on json array?

I wanted to ask that in a php script of mine which I am accessing through an ajax request, I am returning json data ( converted from an array ) as such
echo json_encode($row_array);
I get this data in jquery and display it in a form. Do i need to apply htmlspecialchars / htmlentites before returning the data?
Is do then whats the correct way to do it? The following code gives me an error:
echo htmlentities(json_encode($row_array));
Thanking you
Imran
Do not apply htmlentities in this way. You should walk the array before json encoding it and escape each element, then json encode the array of safe-to-display values. In your usage json is just a transport layer for the array. You are not displaying the json array, just the element data. Don't escape transport layers--it could make the json string invalid.
Context is important.
You don't need to escape the data at all on the server side if it's going into a form input's value if you are using jQuery's val() function to populate it.
Example: http://jsfiddle.net/Y6TWv/1/
var data = '<strong>STRONG TEXT</strong>';
$('input').val(data); // output is escaped
$('p').text(data); // output is escaped
$('p').html(data); ​ // output is not escaped
In addition, if you were to escape the data, don't do it like this:
// escapes the entire json string, not good - quotes will be broken
echo htmlentities(json_encode($row_array));
You would have to escape each item of $row_array first before json encoding it, either with array_map after the array is built, or as you're building the array.
In general, you should prefer htmlspecialchars over htmlentities, but it's not likely you need either one.
I just had a problem with single quotes in a JSON array. Chrome doesn't like single quotes in a JSON response returned via ajax. I escaped each value with htmlspecialchars(, ENT_QUOTES).
$theoptions['MemberList'] = array();
while($row = mssql_fetch_assoc($result)) {
$memberelement = array(
'Display'=> htmlspecialchars($row['FullName'], ENT_QUOTES),
'Value' => $row['ID']);
$theoptions['MemberList'][] = $memberelement;
}
header('Content-Type: application/json');
echo json_encode($theoptions);

Categories