public static function attributes(array $attributes = array())
    {
        $formattedAttributes = array();

        foreach ($attributes as $name => $value) {
            if (is_null($value)) {
                continue;
            }
            $name = is_string($name) ? $name : $value;
            $formattedAttributes[$name] = $name . '="' . self::escape($value) . '"';
        }

        return $formattedAttributes ? ' ' . implode(' ', $formattedAttributes) : '';
    }
public static function attributes(array $attributes = array())
    {
        $formattedAttributes = array();

        foreach ($attributes as $name => $value) {
            if (is_null($value)) {
                continue;
            }
            $name = is_string($name) ? $name : $value;
            $formattedAttributes[$name] = $name . '="' . self::escape($value) . '"';
        }

        return $formattedAttributes ? ' ' . implode(' ', $formattedAttributes) : '';
    }
public static function attributes ( array $ attributes = array ( ) ) { $ formattedAttributes = array ( ) ; foreach ( $ attributes as $ name => $ value ) { if ( is_null ( $ value ) ) { continue ; } $ name = is_string ( $ name ) ? $ name : $ value ; $ formattedAttributes [ $ name ] = $ name . '="' . self :: escape ( $ value ) . '"' ; } return $ formattedAttributes ? ' ' . implode ( ' ' , $ formattedAttributes ) : '' ; }
Converts the array of attribute names and values into a valid HTML string.

@param  array  $attributes The name and values of the attributes.
@return string             A valid HTML attribute string.
Converts the array of attribute names and values into a valid HTML string .