public static function mergeAssocArray($to, $from, $clobber = true)
    {
        if ( is_array($from) ) {
            foreach ($from as $k => $v) {
                if (!isset($to[$k])) {
                    $to[$k] = $v;
                } else {
                    $to[$k] = self::mergeAssocArray($to[$k], $v, $clobber);
                }
            }

            return $to;
        }

        return $clobber ? $from : $to;
    }
public static function mergeAssocArray($to, $from, $clobber = true)
    {
        if ( is_array($from) ) {
            foreach ($from as $k => $v) {
                if (!isset($to[$k])) {
                    $to[$k] = $v;
                } else {
                    $to[$k] = self::mergeAssocArray($to[$k], $v, $clobber);
                }
            }

            return $to;
        }

        return $clobber ? $from : $to;
    }
public static function mergeAssocArray ( $ to , $ from , $ clobber = true ) { if ( is_array ( $ from ) ) { foreach ( $ from as $ k => $ v ) { if ( ! isset ( $ to [ $ k ] ) ) { $ to [ $ k ] = $ v ; } else { $ to [ $ k ] = self :: mergeAssocArray ( $ to [ $ k ] , $ v , $ clobber ) ; } } return $ to ; } return $ clobber ? $ from : $ to ; }
Merge contents from one associtative array to another

@param array $to
@param array $from
@param bool  $clobber
Merge contents from one associtative array to another