public function buildAttrFromArray(array $array)
    {
        $attributes = [];

        foreach ($array as $attribute => $data) {
            if (is_array($data)) {
                $data = implode(' ', $data);
            }

            $attributes[] = $attribute . '="' . htmlspecialchars($data) . '"';
        }

        return $attributes ? ' ' . implode(' ', $attributes) : '';
    }
public function buildAttrFromArray(array $array)
    {
        $attributes = [];

        foreach ($array as $attribute => $data) {
            if (is_array($data)) {
                $data = implode(' ', $data);
            }

            $attributes[] = $attribute . '="' . htmlspecialchars($data) . '"';
        }

        return $attributes ? ' ' . implode(' ', $attributes) : '';
    }
public function buildAttrFromArray ( array $ array ) { $ attributes = [ ] ; foreach ( $ array as $ attribute => $ data ) { if ( is_array ( $ data ) ) { $ data = implode ( ' ' , $ data ) ; } $ attributes [ ] = $ attribute . '="' . htmlspecialchars ( $ data ) . '"' ; } return $ attributes ? ' ' . implode ( ' ' , $ attributes ) : '' ; }
Builds HTML tag attributes from an array of attributes data

@param array $array
@return string
Builds HTML tag attributes from an array of attributes data