首页 > Web开发 > 详细

php getallheaders使用注意事项

时间:2014-06-29 00:31:51      阅读:386      评论:0      收藏:0      [点我收藏+]

This function is an alias for apache_request_headers(). Please read the apache_request_headers() documentation for more information on how this function works.

 

so if you want to use this function in any platform,you should detect if it is exists:

if (!function_exists(‘getallheaders‘))
{
    function getallheaders()
    {
        $headers = ‘‘;
        foreach ($_SERVER as $name => $value)
        {
            if (substr($name, 0, 5) == ‘HTTP_‘)
            {
                $headers[str_replace(‘ ‘, ‘-‘, ucwords(strtolower(str_replace(‘_‘, ‘ ‘, substr($name, 5)))))] = $value;
            }
        }
        return $headers;
    }
}

  

php getallheaders使用注意事项,布布扣,bubuko.com

php getallheaders使用注意事项

原文:http://www.cnblogs.com/libmw/p/3794157.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!