PHP获取header头部信息

获取header信息

/**
    *
    *接收头信息
 **/
     function em_getallheaders()
    {
       foreach ($_SERVER as $name => $value)
       {
           if (substr($name, 0, 5) == 'HTTP_')
           {
               $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
           }
       }
       return $headers;
    }

如图
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/ahaotata/article/details/84999015
今日推荐