WebSocket::getheaders PHP Method

getheaders() public method

public getheaders ( $req )
    function getheaders($req)
    {
        $r = $h = $o = null;
        if (preg_match("/GET (.*) HTTP/", $req, $match)) {
            $r = $match[1];
        }
        if (preg_match("/Host: (.*)\r\n/", $req, $match)) {
            $h = $match[1];
        }
        if (preg_match("/Origin: (.*)\r\n/", $req, $match)) {
            $o = $match[1];
        }
        return array($r, $h, $o);
    }