A remote PHP (that I do a php include with) file returns this data:
{"temp":"57.6","dev":"0.4","city":"Williamston","country":"United States","count":"72690"}
I want to take that data and load it into an array so I can do things with it, and I'm stuck with that part. :-) Any help would be appreciated!
I've tried different syntax as you see in what I'm trying to display.
<?php include("filename.php"); ?>
<?php
function data() {
$datalist = array(
"currenttemp" => "temp",
"deviation" => "dev",
"last_processed" => "city",
"country" => "country",
"stations_processed" => "count",
); } ?>
<table width="280" border="1">
<tbody>
<tr>
<td>Current World Temp:</td>
<td><?php echo $datalist[0]["temp"]; ?></td>
</tr>
<tr>
<td>Deviation:</td>
<td><?php print "$deviation"; ?></td>
</tr>
<tr>
<td>Last Station Processed:</td>
<td><?php print "$last_processed"; ?>, <?php print "$country"; ?></td>
</tr>
<tr>
<td>tations Processed Last Hour:</td>
<td><?php print "$stations_processed"; ?></td>
</tr>
json_decode(). Demo: 3v4l.org/GfOsQ