get a Request Header and all Information get

//******************************get a Request Header and all Information get******************************
function getRequestHeadersf()
{
    //$headers = apache_response_headers();   
    //echo json_encode($headers);
    $headers1 = apache_request_headers();
    $request = array();
    //$response['status'] = $status;

    foreach($headers1 as $key=>$value)
    {
        if($key == 'Host')
        {
            $request['Host'] = $value;
        }
        if($key == 'Connection')
        {
            $request['Connection'] = $value;
        }
        if($key == 'username')
        {
            $request['username'] = $value;
        }
        if($key == 'User-Agent')
        {
            $request['User-Agent'] = $value;
        }
        if($key == 'key')
        {
            $request['key'] = $value;
        }
        if($key == 'Accept')
        {
            $request['Accept'] = $value;
        }
        if($key == 'Accept-Encoding')
        {
            $request['Accept-Encoding'] = $value;
        }
        if($key == 'Accept-Language')
        {
            $request['Accept-Language'] = $value;
        }
        if($key == 'Cookie')
        {
            $request['Cookie'] = $value;
        }
    }
    return json_encode($request);   
}
Share on Google Plus

About quora Questions & Answers A-Z

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment