le problème c'est que je ne suis pas fort en programmation web
Code : Tout sélectionner
$content = file_get_contents($url);
$object = json_decode($content);
var_dump($object);
Code : Tout sélectionner
object(stdClass)[1]
public 'head' => string 'success' (length=7)
public 'body' =>
object(stdClass)[2]
public 'zibase' =>
object(stdClass)[3]
public 'id' => string 'ZiBASE005383' (length=12)
public 'connected' => int 1
public 'variables' =>
...
Code : Tout sélectionner
$object['body']['id']Code : Tout sélectionner
array (size=2)
'head' => string 'success' (length=7)
'body' =>
array (size=7)
'id' => string 'ZA14' (length=4)
'name' => string 'C1 SP103-2' (length=10)
'icon' => string 'logotype_Presence.png' (length=21)
'protocol' => int 19
'status' => int 0
'time' => int 1464873186
'Zwstatus' =>
array (size=3)
'presence' => int 1
'error' => int 0
'battery' => int 0Code : Tout sélectionner
echo $deco['body']['id']Maintenant pour accéder à Zwstatus tu es obligé de passer par l'élément bodyZA14