ktamas77 / firebase-php

Firebase PHP Client
791 stars 215 forks source link

How do I know if get () returned any results? #69

Open ivent opened 7 years ago

ivent commented 7 years ago

Hello, I am getting an error while scanning the field through the foreach when there is no element of the table I wanted to just display there is no element registered, however I can not check the null test on the return of get someone could help me?

$ListFire = new \Firebase\FirebaseLib(DEFAULT_URL, DEFAULT_TOKEN);
$getListFire = $ListFire->get('/users/');
$decodeListFire = json_decode($getListFire);

if($decodeListFire===null){
// foreach....
}

// Not Work not return true or false in If