接口返回带有头部的信息:
$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);