Q:
Get JSON data from php file
I am able to get JSON data from a webservice using jQuery and posting it to my local php file. The data is then used by a function and put into an array. I need to get this array back to the original php file, but I can't seem to get it. I am able to echo the array and it looks like this:
string(17) "{"1":{"date":"/Date(1294934761373)/","description":"Helgoland 50°N. The best location of all
United States","extra":[{"description":"This data is for informational purposes only.","time":"/Date(1294932166013)/"},{"description":"*|WR|20|3.0|-2.0|R+","time":"/Date(1294932366013)/"}]}}"
The array is returned by the getJSON function and is defined as $array. This is the code I'm using to access the data:
$json_data = file_get_contents('');
$array = json_decode($json_data);
And this is how I'm trying to get the data back to the original file:
echo json_encode($array,JSON_PRETTY_PRINT);
When I try to use the data from the array I get nothing back, and no errors.
A:
You should first output the $array data you have before the JSON_PRETTY_PRINT. So it would be something like:
echo $array;
echo json_encode($array, JSON_PRETTY_PRINT);
If you are using codeigniter for example, you may want to use your controller method to output the array:
echo $this->json_data->data;
echo json_encode($this->json_data->data, JSON_PRETTY_PRINT);
This should work.
Q:
How to apply multiple color fills to only non-zero values in ArcGIS?
I would like to color all the cells which are not zero in a layer using only an RGB color.
I found that a generic expression to select the non-zero pixels from a layer can be achieved using a be359ba680
Related links:
Comments