当我向Guzzle提出请求时:
$response = json_decode($client->get($uri)->getBody()->getContents());
var_dump($response); die;
我在var_dump中得到这个:
stdClass (object) [Object ID #2395][3 properties]
contacts:
(array) [250 elements]
has-more: (boolean) true
vid-offset: (integer) 111259
当我做
$response->contacts
我有所有的联系人,没问题,除了这个
vid-offset
有一个
-
以它的名字,所以这不起作用:
$response->vid-offset
我也尝试过:
$response['vid-offset'];
我得到这个错误:
Cannot use object of type stdClass as array
我也试过这样做:
$response->getAttribute('vid-offset')
但它仍然不起作用。
如何获取
补偿偏移
财产?