public static function mergeAttrs($b, $a, $combineClasses = true, $combineStyles = true)
    {
        $a = self::parseAtts($a);
        $b = self::parseAtts($b);

        if ($combineClasses && isset($a['class']) && isset($b['class'])) {
            $a['class'] = self::mergeClasses($a['class'], $b['class']);
            unset($b['class']);
        }

        if ($combineStyles && isset($a['style']) && isset($b['style'])) {
            $a['style'] = self::mergeStyles($a['style'], $b['style']);
            unset($b['style']);
        }

        $r = array_merge($b, $a);

        ksort($r);

        return $r;
    }
public static function mergeAttrs($b, $a, $combineClasses = true, $combineStyles = true)
    {
        $a = self::parseAtts($a);
        $b = self::parseAtts($b);

        if ($combineClasses && isset($a['class']) && isset($b['class'])) {
            $a['class'] = self::mergeClasses($a['class'], $b['class']);
            unset($b['class']);
        }

        if ($combineStyles && isset($a['style']) && isset($b['style'])) {
            $a['style'] = self::mergeStyles($a['style'], $b['style']);
            unset($b['style']);
        }

        $r = array_merge($b, $a);

        ksort($r);

        return $r;
    }
public static function mergeAttrs ( $ b , $ a , $ combineClasses = true , $ combineStyles = true ) { $ a = self :: parseAtts ( $ a ) ; $ b = self :: parseAtts ( $ b ) ; if ( $ combineClasses && isset ( $ a [ 'class' ] ) && isset ( $ b [ 'class' ] ) ) { $ a [ 'class' ] = self :: mergeClasses ( $ a [ 'class' ] , $ b [ 'class' ] ) ; unset ( $ b [ 'class' ] ) ; } if ( $ combineStyles && isset ( $ a [ 'style' ] ) && isset ( $ b [ 'style' ] ) ) { $ a [ 'style' ] = self :: mergeStyles ( $ a [ 'style' ] , $ b [ 'style' ] ) ; unset ( $ b [ 'style' ] ) ; } $ r = array_merge ( $ b , $ a ) ; ksort ( $ r ) ; return $ r ; }
Merge two sets of Tag attributes.

@param  string|array $a
@param  string|array $b
@param  boolean $combineClasses set false to overwrite classes of $b by the ones from $a
@param  boolean $combineStyles  set false to overwrite styles of $b by the ones from $a
@return array
Merge two sets of Tag attributes .