Monday, 12 March 2018

JSON to PHP variable with integer

I've got this JSON Output:



{"ok":true,"license":"CC BY 4.0 -  http:\/\/creativecommons.tankerkoenig.de","data":"MTS-K","prices":{"90d20149-1047-43d3-9b80-4c6f7fd22499":{"status":"open","e5":1.479,"e10":1.459,"diesel":1.259}}}


and I want to get the values of e5, e10 and diesel into a PHP Variable. Like:



$Tankstelle = json_decode($json);
$PriceE5 = (float)utf8_decode($Tankstelle->prices->90d20149-1047-43d3-9b80-4c6f7fd22499->e5);



But it doesnt work, as there is this integer as a value. Can you help me? Thank you!

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...