public static function canonicalizeKey($key)
    {
        $words = explode('-', strtolower($key));

        foreach ($words as &$word) {
            $word = ucfirst($word);
        }

        return implode('-', $words);
    }
public static function canonicalizeKey($key)
    {
        $words = explode('-', strtolower($key));

        foreach ($words as &$word) {
            $word = ucfirst($word);
        }

        return implode('-', $words);
    }
public static function canonicalizeKey ( $ key ) { $ words = explode ( '-' , strtolower ( $ key ) ) ; foreach ( $ words as & $ word ) { $ word = ucfirst ( $ word ) ; } return implode ( '-' , $ words ) ; }
Canonicalize a header key

The canonical format is all lower case except for
the first letter of "words" separated by a hyphen

@link http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
@param string $key The ("field") key of the header
@return string
Canonicalize a header key