You can cast to an array and then check if it is empty or not
$arr = (array)$obj;
if (!$arr) {
// do stuff
}
More Related Contents:
- How to access object data and display the comments
- How can I sort arrays and data in PHP?
- How to access object properties with names like integers or invalid property names?
- How to convert an array to object in PHP?
- Sort array of objects by object fields
- Calling closure assigned to object property directly
- How to get protected property of object in PHP
- How to find entry by object property from an array of objects?
- How do I access this object property with an illegal name?
- Trying to get property of non-object – Laravel 5
- Sort array of objects by one property
- Serializing PHP object to JSON
- mysql_fetch_array, mysql_fetch_assoc, mysql_fetch_object
- How to Cast Objects in PHP
- PHP Objects vs Arrays — Performance comparison while iterating
- How to convert a string to JSON object in PHP
- How to destroy an object?
- PHP __PHP_Incomplete_Class Object with my $_SESSION data
- Return PHP object by index number (not name)
- PHP Object Assignment vs Cloning
- Creating anonymous objects in php
- passing PHP objects to javascript [duplicate]
- PHP 5: const vs static
- How do you pass objects by reference in PHP 5?
- How to create new property dynamically
- Array of PHP Objects
- Object of class stdClass could not be converted to string
- How to fix ‘Creating default object from empty value’ warning in PHP [duplicate]
- stdClass object and foreach loops
- How to get the object or class name?