Pemeriksaan PHP objek kosong
$arr = (array)$obj;
if (!$arr) {
// do stuff
}
Super Dude
$arr = (array)$obj;
if (!$arr) {
// do stuff
}
if (empty($var)) {
echo '$var is either 0, empty, or not set at all';
}
$x = new stdClass();
if($users->count()==0){
$result->errer = "not exist";
}