Iwhite Posted January 16, 2016 Share Posted January 16, 2016 <?php $id = $row->field_ets2mp_id_value_raw;$tracker = json_decode(@file_get_contents("http://tracker.ets2map.com/doko/$id")); if ($tracker) { $status = $tracker->online; if ($status) { echo "Connecté sur le Multi"; } else { echo "Non connecté sur le Multi"; } } else { echo "<b>• Probleme Page API</b><br />"; }?> Hi, For the code, why all time return Connecter sur le multi that is she True or False ? Link to comment Share on other sites More sharing options...
0 Guest Posted January 16, 2016 Share Posted January 16, 2016 you have to cast $tracker->online to bool Link to comment Share on other sites More sharing options...
0 Zelcrum Posted January 16, 2016 Share Posted January 16, 2016 Hi, is your problem solved?Regards Zelcrum Link to comment Share on other sites More sharing options...
0 Iwhite Posted January 17, 2016 Author Share Posted January 17, 2016 In variable status I have well True and False works of the api there, except that the condition IF does not make the difference Link to comment Share on other sites More sharing options...
0 ItzKieren Posted January 25, 2016 Share Posted January 25, 2016 Topic Inactive, moving to unsolved. > Joined 29 Nov 2014 - 10 Year Anniversary < History Previously known as Louie G Former Truckers.FM Station Manager & Presenter Former Apollo Logistics, Atlas Logistics & Nordic LTD Manager Link to comment Share on other sites More sharing options...
Question
Iwhite
Hi, For the code, why all time return Connecter sur le multi that is she True or False ?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts