public static function replace(DOMAttr $attribute, callable $callback)
	{
		$tokens = self::parse($attribute->value);
		foreach ($tokens as $k => $token)
		{
			$tokens[$k] = $callback($token);
		}

		$attribute->value = htmlspecialchars(self::serialize($tokens), ENT_NOQUOTES, 'UTF-8');
	}
public static function replace(DOMAttr $attribute, callable $callback)
	{
		$tokens = self::parse($attribute->value);
		foreach ($tokens as $k => $token)
		{
			$tokens[$k] = $callback($token);
		}

		$attribute->value = htmlspecialchars(self::serialize($tokens), ENT_NOQUOTES, 'UTF-8');
	}
public static function replace ( DOMAttr $ attribute , callable $ callback ) { $ tokens = self :: parse ( $ attribute -> value ) ; foreach ( $ tokens as $ k => $ token ) { $ tokens [ $ k ] = $ callback ( $ token ) ; } $ attribute -> value = htmlspecialchars ( self :: serialize ( $ tokens ) , ENT_NOQUOTES , 'UTF-8' ) ; }
Replace the value of an attribute via the provided callback

The callback will receive an array containing the type and value of each token in the AVT.
Its return value should use the same format

@param  DOMAttr  $attribute
@param  callable $callback
@return void
Replace the value of an attribute via the provided callback