过滤掉接口头部信息
接口返回带有头部的信息:
$get_quota = $get_form_model->check_quota_model($ebay_accountname);
//根据account 获取quota的信息
HTTP/1.1 200 OK
RlogId: t6sbe%3D9iptsbe*1156%3A3%3F%29pqtfwpu%29osu%29fgg%7E-fij-163dd3f9c80-0xe5
X-EBAY-C-VERSION: 1.0.0
X-EBAY-REQUEST-ID: 163dd3f9-c800-aa42-e117-5f5dfffffe7d![]
Set-Cookie: ebay=%5Esbf%3D%23%5E;
Domain=.ebay.com;
Path=/
Content-Type: application/json
Content-Length: 231
Date: Fri, 08 Jun 2018 02:35:23 GMT
Server: ebay server
{"ackValue":"SUCCESS","responseStatus":200,"data":{"pgcEligibility":false,"remainingQuota":null,"limitQty":null,"limitEligibility":null,"segMent":null,"subSegment":null,"maxAspForTop":null},"timeStamp":1528425323675,"message":null}
【过滤掉接口头部信息】过滤掉头部的信息:
$get_quota = $get_form_model->check_quota_model($ebay_accountname);
//根据account 获取quota的信息
添加以下三行代码:
$pos = strpos($get_quota, "\r\n\r\n");
$get_quota = substr($get_quota, $pos+4);
$quota_arr = json_decode($get_quota,true);
推荐阅读
- JAVA(抽象类与接口的区别&重载与重写&内存泄漏)
- 太平之莲
- 七年之痒之后
- 牛人进化+|牛人进化+ 按自己的意愿过一生
- 基于微信小程序带后端ssm接口小区物业管理平台设计
- 2020-04-07vue中Axios的封装和API接口的管理
- 2021-02-10(找不回的“年味”……)
- 生命过客——第10章|生命过客——第10章 初为人母
- gitlab|gitlab 通过备份还原 admin/runner 500 Internal Server Error
- 回忆曾经看过的小说