php json_decode error quoted object property name expected - php

I try to create a script that decoding a simple JSON string in PHP and I get the following error:
quoted object property name expected
The string I try to decode is the following :
{"values":[{"url":"http://www.google.com","matches":"http|www|google|com"},{"url":"http://www.yahoo.com","matches":"http|www|yahoo|com"}]}
and the code I use to decoded is the following:
json_decode( $json_string );
I also have try to validate my json string in some online json validators, and the string seems to be fine.
Can someone please help me ?
Do you think the problem exists because of the double quotes ?
Update #1
Definetelly was a debuging issue. I place my experience here just to help other devs may come accross the same issue in the feature:
The problem was that my variable that came with the json string was html encoded so instead of the following string :
{"values":[{"url":"http://www.google.com","matches":"http|www|google|com"},{"url":"http://www.yahoo.com","matches":"http|www|yahoo|com"}]}
my variable came with the following string inside :
{"values":[{"url":"http://www.google.com","matches":"http|www|google|com"},{"url":"http://www.yahoo.com","matches":"http|www|yahoo|com"}]}
The mistake by my side was that I used the print_r method instead of the var_dump . This had as a result to print out the &quot as " in my page .

The json string is valid, and it works. You can add true for the second parameter of json_decode, and you get back an array.
Try the following:
$json_string = '{"values":[{"url":"http://www.google.com","matches":"http|www|google|com"},{"url":"http://www.yahoo.com","matches":"http|www|yahoo|com"}]}';
var_dump(json_decode($json_string, true));
It works for me.

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

PHP Json Values from Keys not being parsed from External API Call

I am trying to make an external API call to fetch JSON data and return it within my web app.
Here is what the data looks like from the API call:
JSON returned from URL:
{
"results":[
{
"name":"Company1",
"ProviderName": "ProviderName1",
"ProviderLogo": "/images/some_image1.jpg",
"GetURL": "/some_url_path",
"Costs": 10000.50
},{
"name":"Company2",
"ProviderName": "ProviderName2",
"ProviderLogo": "/images/some_image2.jpg",
"applyURL": "/some_url_path",
"Costs": 12000.50
}]
}
Since I am using PHP, I am using the following code:
$api_data = file_get_contents('MY URL');
// Had to use 'encoded_json()' since 'json_decode()' was initially returning NULL
$encoded_json = json_encode($api_data);
$decoded_json = json_decode($encoded_json);
// Now I want to get the specific values from the JSON result but nothing is being returned
// I tried using something like this but I'm not getting anything
foreach($decoded_json->results as $mydata)
{
echo 'Decoded Name: ' . $mydata->name . "\n";
}
Any help is greatly appreciated!
EDIT:
So this what was actually happening and I'm going to apologize to everyone in advance right now because I didn't include what was actually throwing the error off in the first place!
I used JSON Lint and put all of the API Json data that I was receiving and it showed me where the error was occurring.
Error:
"SomeCostUpper": $some_variable.rawUpperCost
I tested out my PHP code using valid JSON and was able to return the results without a problem.
Everyone, I'm really sorry for the confusion but thanks for your efforts!
$api_data = file_get_contents('MY URL');
You now have a string containing the data in that URL.
// Had to use 'encoded_json()' since 'json_decode()' was initially returning NULL
If json_decode returns NULL, then the string you had does not contain valid JSON.
$encoded_json = json_encode($api_data);
You now have a string representation of a string containing the data from the URL.
$decoded_json = json_decode($encoded_json);
And now you have reversed that, so you have your original string back.
foreach($decoded_json->results as $mydata)
It is a string. You can't do that.
You need to fix the data you are getting from MY URL.
Use a tool like JSON Lint, which will give you an error like:
Error: Parse error on line 7:
..."Costs": 10000.50, }, { "name": "Comp
----------------------^
Expecting 'STRING', got '}'
You have a rogue comma after the last entry in your object.
This is likely caused by generating JSON by mashing together strings or by writing it by hand. Avoid that. Use tools and libraries designed to generate JSON.
I don't know from which website you get that JSON data, but it isn't valid JSON, that is why json_decode() initially returned NULL. There are 2 commas (each costs value has one) that shouldn't be there.
You "fixed" that by using first json_encode() and then json_decode() on the JSON data returned from the API call. You might think that that fixed your problem but no, if you take a look at what is inside $decoded_json you will see that there isn't an object or an array which you can use.
That means that when you try to do
foreach($decoded_json->results as $mydata)
{
echo 'Decoded Name: ' . $mydata->name . "\n";
}
It fails because it cannot iterate over the 'string' inside $decoded_json.
If you had turned on error reporting you would have seen the following errors:
E_NOTICE : type 8 -- Trying to get property of non-object -- at line n
E_WARNING : type 2 -- Invalid argument supplied for foreach() -- at line n
the json is ok, you don't need to encode and then decode again...
just do:
$api_data = file_get_contents('MY URL');
$decoded_json = json_decode($api_data );
foreach($decoded_json->results as $mydata)
{
echo 'Decoded Name: ' . $mydata->name . "\n";
}
Your JSON data is not valid. Here is the valid JSON structure.
Remove the ',' from the last elemp "Costs": "10000.50" and use double quote for the value as "10000.50".

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

PHP says that this json is invalid because "object property name separator ':' expected", can anyone see why?

What's wrong with this json:
{ "items" : [ {"timestamp":"1372964400","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1373666400","value":"2","nid":"593141","platform":"-1"},{"timestamp":"1371398400","value":"1","nid":"34872","platform":"-1"},{"timestamp":"1374238800","value":"2","nid":"59251","platform":"-1"},{"timestamp":"1371902400","value":"1","nid":"79534","platform":"-1"},{"timestamp":"1373425200","value":"1","nid":"583657","platform":"-1"},{"timestamp":"1376251200","value":"4","nid":"701275","platform":"-1"},{"timestamp":"1371330000","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1372183200","value":"1","nid":"81447","platform":"-1"},{"timestamp":"1372348800","value":"2","nid":"83560","platform":"-1"},{"timestamp":"1373162400","value":"1","nid":"583657","platform":"-1"},{"timestamp":"1374174000","value":"2","nid":"607389","platform":"-1"},{"timestamp":"1371834000","value":"2","nid":"79534","platform":"-1"},{"timestamp":"1372723200","value":"1","nid":"190555","platform":"-1"},{"timestamp":"1373385600","value":"2","nid":"590502","platform":"-1"},{"timestamp":"1375855200","value":"1","nid":"697831","platform":"-1"},{"timestamp":"1372312800","value":"1","nid":"81447","platform":"-1"},{"timestamp":"1373047200","value":"2","nid":"545517","platform":"-1"},{"timestamp":"1373929200","value":"3","nid":"605563","platform":"-1"},{"timestamp":"1375462800","value":"1","nid":"647466","platform":"-1"},{"timestamp":"1376434800","value":"5","nid":"704771","platform":"-1"},{"timestamp":"1371722400","value":"1","nid":"79534","platform":"-1"},{"timestamp":"1372240800","value":"1","nid":"82257","platform":"-1"},{"timestamp":"1372687200","value":"1","nid":"190555","platform":"-1"},{"timestamp":"1373367600","value":"1","nid":"590502","platform":"-1"},{"timestamp":"1374634800","value":"1","nid":"610377","platform":"-1"},{"timestamp":"1375812000","value":"1","nid":"697482","platform":"-1"},{"timestamp":"1372129200","value":"1","nid":"81157","platform":"-1"},{"timestamp":"1372287600","value":"1","nid":"79568","platform":"-1"},{"timestamp":"1372989600","value":"1","nid":"40191","platform":"-1"},{"timestamp":"1373788800","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1375376400","value":"1","nid":"646893","platform":"-1"},{"timestamp":"1376420400","value":"1","nid":"704624","platform":"-1"},{"timestamp":"1371423600","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1372230000","value":"7","nid":"81447","platform":"-1"},{"timestamp":"1372413600","value":"1","nid":"118275","platform":"-1"},{"timestamp":"1373306400","value":"5","nid":"590502","platform":"-1"},{"timestamp":"1374264000","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1371960000","value":"1","nid":"79568","platform":"-1"},{"timestamp":"1372924800","value":"1","nid":"82456","platform":"-1"},{"timestamp":"1373558400","value":"3","nid":"590502","platform":"-1"},{"timestamp":"1375092000","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1376280000","value":"1","nid":"701529","platform":"-1"},{"timestamp":"1370044800","value":"1","nid":"68566","platform":"-1"},{"timestamp":"1371380400","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1372183200","value":"3","nid":"81457","platform":"-1"},{"timestamp":"1372352400","value":"1","nid":"83613","platform":"-1"},{"timestamp":"1373194800","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1375689600","value":"1","nid":"687547","platform":"-1"},{"timestamp":"1371902400","value":"2","nid":"59251","platform":"-1"},{"timestamp":"1372762800","value":"1","nid":"212931","platform":"-1"},{"timestamp":"1375977600","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1371322800","value":"2","nid":"59251","platform":"-1"},{"timestamp":"1372179600","value":"1","nid":"81457","platform":"-1"},{"timestamp":"1372345200","value":"2","nid":"83560","platform":"-1"},{"timestamp":"1373068800","value":"1","nid":"545517","platform":"-1"},{"timestamp":"1374163200","value":"1","nid":"607389","platform":"-1"},{"timestamp":"1375470000","value":"1","nid":"647526","platform":"-1"},{"timestamp":"1376460000","value":"1","nid":"705149","platform":"-1"},{"timestamp":"1370278800","value":"1","nid":"57508","platform":"-1"},{"timestamp":"1371765600","value":"2","nid":"79568","platform":"-1"},{"timestamp":"1372690800","value":"1","nid":"212147","platform":"-1"},{"timestamp":"1373382000","value":"9","nid":"590502","platform":"-1"},{"timestamp":"1374674400","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1375819200","value":"1","nid":"697482","platform":"-1"},{"timestamp":"1371132000","value":"1","nid":"76647","platform":"-1"},{"timestamp":"1372143600","value":"1","nid":"81209","platform":"-1"},{"timestamp":"1372302000","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1373036400","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1373886000","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1375380000","value":"1","nid":"646893","platform":"-1"},{"timestamp":"1376427600","value":"1","nid":"704735","platform":"-1"},{"timestamp":"1370260800","value":"3","nid":"68984","platform":"-1"},{"timestamp":"1372240800","value":"1","nid":"82162","platform":"-1"},{"timestamp":"1372428000","value":"1","nid":"154915","platform":"-1"},{"timestamp":"1373364000","value":"6","nid":"590502","platform":"-1"},{"timestamp":"1374606000","value":"1","nid":"610377","platform":"-1"}] }
when running json_decode on this string php returns null.
i've checked with every online php json_decoder and they decode it succesfully.
i've also tried with json_decode($json, TRUE); but the call also returns NULL
i'm on php version PHP 5.5.1-2+debphp.org~precise+2
I've checked what json_last_error_msg() has to say and it returned:
object property name separator ':' expected
This works fine for me under 5.4.3
<?php
$json = '{ "items" : [ {"timestamp":"1372964400","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1373666400","value":"2","nid":"593141","platform":"-1"},{"timestamp":"1371398400","value":"1","nid":"34872","platform":"-1"},{"timestamp":"1374238800","value":"2","nid":"59251","platform":"-1"},{"timestamp":"1371902400","value":"1","nid":"79534","platform":"-1"},{"timestamp":"1373425200","value":"1","nid":"583657","platform":"-1"},{"timestamp":"1376251200","value":"4","nid":"701275","platform":"-1"},{"timestamp":"1371330000","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1372183200","value":"1","nid":"81447","platform":"-1"},{"timestamp":"1372348800","value":"2","nid":"83560","platform":"-1"},{"timestamp":"1373162400","value":"1","nid":"583657","platform":"-1"},{"timestamp":"1374174000","value":"2","nid":"607389","platform":"-1"},{"timestamp":"1371834000","value":"2","nid":"79534","platform":"-1"},{"timestamp":"1372723200","value":"1","nid":"190555","platform":"-1"},{"timestamp":"1373385600","value":"2","nid":"590502","platform":"-1"},{"timestamp":"1375855200","value":"1","nid":"697831","platform":"-1"},{"timestamp":"1372312800","value":"1","nid":"81447","platform":"-1"},{"timestamp":"1373047200","value":"2","nid":"545517","platform":"-1"},{"timestamp":"1373929200","value":"3","nid":"605563","platform":"-1"},{"timestamp":"1375462800","value":"1","nid":"647466","platform":"-1"},{"timestamp":"1376434800","value":"5","nid":"704771","platform":"-1"},{"timestamp":"1371722400","value":"1","nid":"79534","platform":"-1"},{"timestamp":"1372240800","value":"1","nid":"82257","platform":"-1"},{"timestamp":"1372687200","value":"1","nid":"190555","platform":"-1"},{"timestamp":"1373367600","value":"1","nid":"590502","platform":"-1"},{"timestamp":"1374634800","value":"1","nid":"610377","platform":"-1"},{"timestamp":"1375812000","value":"1","nid":"697482","platform":"-1"},{"timestamp":"1372129200","value":"1","nid":"81157","platform":"-1"},{"timestamp":"1372287600","value":"1","nid":"79568","platform":"-1"},{"timestamp":"1372989600","value":"1","nid":"40191","platform":"-1"},{"timestamp":"1373788800","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1375376400","value":"1","nid":"646893","platform":"-1"},{"timestamp":"1376420400","value":"1","nid":"704624","platform":"-1"},{"timestamp":"1371423600","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1372230000","value":"7","nid":"81447","platform":"-1"},{"timestamp":"1372413600","value":"1","nid":"118275","platform":"-1"},{"timestamp":"1373306400","value":"5","nid":"590502","platform":"-1"},{"timestamp":"1374264000","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1371960000","value":"1","nid":"79568","platform":"-1"},{"timestamp":"1372924800","value":"1","nid":"82456","platform":"-1"},{"timestamp":"1373558400","value":"3","nid":"590502","platform":"-1"},{"timestamp":"1375092000","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1376280000","value":"1","nid":"701529","platform":"-1"},{"timestamp":"1370044800","value":"1","nid":"68566","platform":"-1"},{"timestamp":"1371380400","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1372183200","value":"3","nid":"81457","platform":"-1"},{"timestamp":"1372352400","value":"1","nid":"83613","platform":"-1"},{"timestamp":"1373194800","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1375689600","value":"1","nid":"687547","platform":"-1"},{"timestamp":"1371902400","value":"2","nid":"59251","platform":"-1"},{"timestamp":"1372762800","value":"1","nid":"212931","platform":"-1"},{"timestamp":"1375977600","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1371322800","value":"2","nid":"59251","platform":"-1"},{"timestamp":"1372179600","value":"1","nid":"81457","platform":"-1"},{"timestamp":"1372345200","value":"2","nid":"83560","platform":"-1"},{"timestamp":"1373068800","value":"1","nid":"545517","platform":"-1"},{"timestamp":"1374163200","value":"1","nid":"607389","platform":"-1"},{"timestamp":"1375470000","value":"1","nid":"647526","platform":"-1"},{"timestamp":"1376460000","value":"1","nid":"705149","platform":"-1"},{"timestamp":"1370278800","value":"1","nid":"57508","platform":"-1"},{"timestamp":"1371765600","value":"2","nid":"79568","platform":"-1"},{"timestamp":"1372690800","value":"1","nid":"212147","platform":"-1"},{"timestamp":"1373382000","value":"9","nid":"590502","platform":"-1"},{"timestamp":"1374674400","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1375819200","value":"1","nid":"697482","platform":"-1"},{"timestamp":"1371132000","value":"1","nid":"76647","platform":"-1"},{"timestamp":"1372143600","value":"1","nid":"81209","platform":"-1"},{"timestamp":"1372302000","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1373036400","value":"1","nid":"545500","platform":"-1"},{"timestamp":"1373886000","value":"1","nid":"59251","platform":"-1"},{"timestamp":"1375380000","value":"1","nid":"646893","platform":"-1"},{"timestamp":"1376427600","value":"1","nid":"704735","platform":"-1"},{"timestamp":"1370260800","value":"3","nid":"68984","platform":"-1"},{"timestamp":"1372240800","value":"1","nid":"82162","platform":"-1"},{"timestamp":"1372428000","value":"1","nid":"154915","platform":"-1"},{"timestamp":"1373364000","value":"6","nid":"590502","platform":"-1"},{"timestamp":"1374606000","value":"1","nid":"610377","platform":"-1"}] }';
$json_object = json_decode($json);
var_dump($json_object);
Maybe it's your json_decode that's causing the issue.
You can pass an extra argument to json_decode that changes the returned value from an object (by default) to an array.
$json_array = json_decode($json, true);
See json_decode
Either there is a bug in your installation of PHP (you're using a release candidate, so that could be the issue) or there are some kind of illegal characters in the JSON file, which might not be posted here because stack overflow probably deletes weird characters.
Try a different version of PHP, or try going over the JSON code with a Hex Editor (I like HedFiend personally, but it only works on a mac).
Also try running json_decode() on partial snippets of the string instead of the entire thing.
You can go to this URL and have a nice look # your JSON :)
http://jsonviewer.stack.hu/

Categories