Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function empty_recursive($o)
- {
- // This block is optional and could/should be removed. I'd deal with arrays
- // only
- if (is_object($o)) {
- return empty_recursive((array) $o);
- }
- if (is_array($o)) {
- foreach ($o as $element) {
- if (!empty_recursive($element)) {
- return false;
- }
- }
- return true;
- }
- return empty($o);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement