diff --git a/src/Xml2Array.class.php b/src/Xml2Array.class.php index 6e2bab4..1ba97e1 100644 --- a/src/Xml2Array.class.php +++ b/src/Xml2Array.class.php @@ -199,7 +199,7 @@ private static function processArray($root) if (!isset($result[$child->nodeName])) { $childNode = self::processArray($child); //Needs to return atleast 1 result - if (count($childNode) >= 1) { + if (!empty($childNode)) { $result[$child->nodeName] = $childNode; } } else { @@ -209,7 +209,7 @@ private static function processArray($root) } $childNode = self::processArray($child); //Needs to return atleast 1 result - if (count($childNode) >= 1) { + if (!empty($childNode)) { $result[$child->nodeName][] = $childNode; } }