// How to find if an object is empty of not in PHP. if (empty((array) $obj)) { //do stuff } // http://stackoverflow.com/questions/9412126/how-to-check-if-an-object-is-empty-in-php