src/dom/Dom.php
public static function mergeNodes($items1, $items2)
    {
        $ret = array();
        $items = array_merge($items1, $items2);
        $len = count($items);

        // collects non-repeated elements
        for ($i = 0; $i < $len; $i++) {
            $item = $items[$i];
            $position = Dom::searchNode($item, $items, $i + 1);
            if ($position === false) {
                array_push($ret, $item);
            }
        }
        
        return $ret;
    }
public static function mergeNodes($items1, $items2)
    {
        $ret = array();
        $items = array_merge($items1, $items2);
        $len = count($items);

        // collects non-repeated elements
        for ($i = 0; $i < $len; $i++) {
            $item = $items[$i];
            $position = Dom::searchNode($item, $items, $i + 1);
            if ($position === false) {
                array_push($ret, $item);
            }
        }
        
        return $ret;
    }
public static function mergeNodes ( $ items1 , $ items2 ) { $ ret = array ( ) ; $ items = array_merge ( $ items1 , $ items2 ) ; $ len = count ( $ items ) ; // collects non-repeated elements for ( $ i = 0 ; $ i < $ len ; $ i ++ ) { $ item = $ items [ $ i ] ; $ position = Dom :: searchNode ( $ item , $ items , $ i + 1 ) ; if ( $ position === false ) { array_push ( $ ret , $ item ) ; } } return $ ret ; }
Merges two lists of nodes in a single list.

This function merges two list of nodes in a single list without repeating
nodes.

@param array $items1 List of DOMNode objects
@param array $items2 List of DOMNode objects

@return array of DOMNode objects
Merges two lists of nodes in a single list .