Formatting a given array into a key="value"-string for each entry.

@param array $attributes

@return string $html
166650
public function attributesToString(array $attributes = []): string
    {
        $html = [];
        foreach ($attributes as $key => $value) {
            if (is_array($value)) {
                $value = json_encode($value);
            }

            if (in_array($key, $this->booleanAttributes, true)) {
                $value = $this->prepareBooleanAttribute($key, $value);
            }

            if ($value === '') {
                continue;
            }

            $html[] = sprintf(
                '%s="%s"',
                $this->escapeAttribute($key),
                $this->escapeAttribute($value)
            );
        }

        return implode(' ', $html);
    }
160453
protected function attributes($attributes = [])
    {
        $ar = [];

        foreach ($attributes as $key => $value) {
            $element = $this->attribute($key, $value);
            if (!is_null($element)) {
                $ar[] = $element;
            }
        }

        return count($ar) > 0 ? ' '.implode(' ', $ar) : '';
    }
848274
public function withAttributes(array $attributes)
    {
        $clone = clone $this;

        foreach ($attributes as $name => $value) {
            $clone->dom->documentElement->setAttribute($name, $value);
        }

        return $clone;
    }
467156
protected static function getAttributesString($attributes)
    {
        $str = '';
        if (is_array($attributes)) {
            $charset = self::getOption('charset');
            foreach ($attributes as $key => $value) {
                $str .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES, $charset) . '"';
            }
        }
        return $str;
    }
25209
public static function buildAttributes($attributes)
    {
        $options = array();
        foreach ($attributes as $attr => $val) {
            $options[] = "{$attr}=\"{$val}\"";
        }
        return implode(' ', $options);
    }
26168
protected static function attribute($attributes = [])
	{
		$text = '';
		foreach ($attributes as $option => $value) {
			$text = ' ' . $option . '="' . $value . '"';
		}
		return $text;
	}
301815
protected function buildHtmlString(array $attributesArray): string
    {
        $html = '';
        foreach ($attributesArray as $key => $attribute) {
            $spacer = strlen($html) ? ' ' : '';
            if ($key && is_string($key)) {
                $html .= $spacer . $key . ($attribute ? '="' . $attribute . '"' : '');
            } else {
                $html .= $spacer . $attribute;
            }
        }

        return $html;
    }
580138
protected function renderAttributes($attributes)
    {
        if (count((array) $attributes) == 0) {
            return '';
        }

        $return = [];

        foreach ($attributes as $key => $value) {
            $return[] = $key . '="' . $value . '"';
        }

        return ' ' . implode(' ', $return);
    }
20688
public function map(array $attributes)
    {
        foreach ($attributes as $key => $value) {
            $this->{$key} = $value;
        }

        return $this;
    }
963698
protected static function prepareAttributes($attributes)
    {
        $prepared = array();
        if (is_string($attributes)) {
            return self::parseAttributes($attributes);

        } elseif (is_array($attributes)) {
            foreach ($attributes as $key => $value) {
                if (is_int($key)) {
                    $key = strtolower($value);
                    $prepared[$key] = $key;
                } else {
                    $prepared[strtolower($key)] = (string)$value;
                }
            }
        }
        return $prepared;
    }
647021
public function datagridAttributes(array $attributes)
    {
        $result = '';

        foreach ($attributes as $attributeName => $attributeValue) {
            $result .= ' '.$attributeName.'="'.$attributeValue.'"';
        }

        return $result;
    }
311218
protected function skipNullValue(array $attributes)
    {
        $attr = [];

        foreach ($attributes as $key => $value) {
            if (null !== $value) {
                $attr[$key] = \is_array($value)
                    ? $this->skipNullValue($value)
                    : $value;
            }
        }

        return $attr;
    }
812301
private function putAttributes($attributes)
	{
		$output = '';

		foreach($attributes as $attribute => $value)
		{
			$output.= ' '.$attribute. '="'.$value.'"';
		}

		return $output;
	}
693955
static function htmlAttributes(array $attributes = array()) {
    foreach ($attributes as $attribute => &$data) {
      $data = implode(' ', (array) $data);
      $data = $attribute . '="' . self::checkPlain($data) . '"';
    }
    return $attributes ? ' ' . implode(' ', $attributes) : '';
  }
920643
protected function buildAttributes(\ArrayObject $attributes)
    {
        $strings = [];

        foreach ($attributes as $key => $value) {
            if (is_array($value)) {
                continue;
            }
            $strings[] = $key . '="' . $value . '"';
        }

        return implode(' ', $strings);
    }
804934
protected function flatten($attributes)
    {
        foreach ($attributes as $name => $value) {
            
            if (is_array($value)) {
                $attributes[$name] = implode(' ', array_filter($value));
            }
            
        }
        
        return $attributes;
    }
1289207
public function getAttributesHTML($attributes)
    {
        // Initialise:
        
        $markup = [];
        
        // Remove Empty Attributes:
        
        $attributes = array_filter($attributes, function ($v) {
            return ($v || $v === 0 || $v === '0');
        });
        
        // Render Remaining Attributes:
        
        foreach ($attributes as $name => $value) {
            $markup[] = sprintf('%s="%s"', $name, ($value === true) ? $name : Convert::raw2att($value));
        }
        
        // Answer Markup:
        
        return implode(' ', $markup);
    }