我有以下要求:
2017-04-05 06:53:31 Error: Cake\Http\ServerRequest Object
(
...
[_environment:protected] => Array
(
[HTTP_REGISTRATION] => eur73_9lhfQ:...SJMryPxCNzKcqSufdpFMOaux
...
)
[_detectorCache:protected] => Array
(
[ajax] =>
[get] => 1
[head] =>
[options] =>
[post] =>
)
[uri:protected] => Zend\Diactoros\Uri Object
(
[allowedSchemes:protected] => Array
(
[http] => 80
[https] => 443
)
...
)
...
)
$this->request->header['registration']
返回:
eur73_9lhfQ:...SJMryPxCNzKcqSufdpFMOaux
作为字符串
$this->request->getHeader('registration') 返回:
[Registration] => Array
(
[0] => eur73_9lhfQ:...SJMryPxCNzKcqSufdpFMOaux
)
为什么它返回一个数组?