header方法獲取當前請求的HTTP請求頭信息:
```
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0
Host: www.example.com
Connection: Keep-Alive
```
```
$info = $this->header();
echo $info['accept'];
echo $info['accept-encoding'];
echo $info['user-agent'];
```
也可以直接獲取某個請求頭信息,例如:
```
$agent = $this->header('user-agent');
```
HTTP請求頭信息的名稱不區分大小寫,并且_會自動轉換為-,所以下面的寫法都是等效的:
```
$agent = $this->header('user-agent');
$agent = $this->header('User-Agent');
$agent = $this->header('User_Agent');
$agent = $this->header('USER_AGENT');
```