How to find if an object is empty or not in PHP.
Following is the code in which $obj is holding XML data. How can I check if it\'s empty or not?
$obj
You can cast to an array and then check if it is empty or not
$arr = (array)$obj; if (!$arr) { // do stuff }