ivoba/headers
最新稳定版本:3.0.0
Composer 安装命令:
composer require ivoba/headers
包简介
A PHP library for working with HTTP and mail message headers
README 文档
README
A PHP library for working with HTTP and mail headers
Install
composer require ivoba/headers
Version 2 requires minimum PHP7.1.
Usage
$headers = Headers::fromString(
'HTTP/1.1 200 OK
Content-Length: 782420
Content-Type: text/xml; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Tue, 28 Nov 2017 16:08:41 GMT'
);
$reason = $headers->getStatusLine()->get(StatusLine::REASON_PHRASE); //OK
$server = $headers->getHeaders()->get('server'); //Microsoft-HTTPAPI/2.0
Tests
Install the dependencies via composer and run
vendor/bin/phpunit
Credits
This is a shameless port of https://github.com/ddeboer/headers which seems to be unmaintained.
统计信息
- 总下载量: 51.93k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2016-04-04