src/filters/Cors.php
protected function headerize($string)
    {
        $headers = preg_split("/[\\s,]+/", $string, -1, PREG_SPLIT_NO_EMPTY);
        $headers = array_map(function ($element) {
            return str_replace(' ', '-', ucwords(strtolower(str_replace(['_', '-'], [' ', ' '], $element))));
        }, $headers);
        return implode(', ', $headers);
    }
protected function headerize($string)
    {
        $headers = preg_split("/[\\s,]+/", $string, -1, PREG_SPLIT_NO_EMPTY);
        $headers = array_map(function ($element) {
            return str_replace(' ', '-', ucwords(strtolower(str_replace(['_', '-'], [' ', ' '], $element))));
        }, $headers);
        return implode(', ', $headers);
    }
protected function headerize ( $ string ) { $ headers = preg_split ( "/[\\s,]+/" , $ string , - 1 , PREG_SPLIT_NO_EMPTY ) ; $ headers = array_map ( function ( $ element ) { return str_replace ( ' ' , '-' , ucwords ( strtolower ( str_replace ( [ '_' , '-' ] , [ ' ' , ' ' ] , $ element ) ) ) ) ; } , $ headers ) ; return implode ( ', ' , $ headers ) ; }
Convert any string (including php headers with HTTP prefix) to header format like :
* X-PINGOTHER -> X-Pingother
* X_PINGOTHER -> X-Pingother
@param string $string string to convert
@return string the result in "header" format
Convert any string ( including php headers with HTTP prefix ) to header format like : * X - PINGOTHER - > X - Pingother * X_PINGOTHER - > X - Pingother