AMP_Base_Sanitizer::add_or_append_attribute( string[] $attributes,  string $key,  string $value,  string $separator = ' ' )

Description #

Adds or appends key and value to list of attributes

Adds key and value to list of attributes, or if the key already exists in the array it concatenates to existing attribute separator by a space or other supplied separator.

Parameters #


(string[]) (Required) { Attributes. @type int $height @type int $width @type string $sizes @type string $class @type string $layout }


(string) (Required) Valid associative array index to add.


(string) (Required) Value to add or append to array indexed at the key.


(string) (Optional) defaults to space but some other separator if needed.

Default value:' '