0
在PHP中使用Stripe API所有试图从其中取出值的操作都返回null,r根本不显示结果。我试过Stripe API JSON返回null
$customers = \Stripe\Customer::all();
$customers_json = $customers->__toJSON();
json_decode($customers_json);
echo $customers_json->data->id;
也
$customers = \Stripe\Customer::all();
$customer = $customers->__toArray(true);
echo $customer["data"]["id"];
但每次结果都在一个空白的回声。然而,当我只输出原始变量而不解析为JSON或任何东西时,它会返回一个完整的JSON值的字符串,而不是解析。的只是原始$customers
输出是
Stripe\Collection JSON: { "object": "list", "has_more": false, "url": "\/v1\/customers", "data": [ { "id": "cus_6u32tOQ6MRXuqm", "object": "customer", "created": 1441114587, "livemode": false, "description": "test customer", "email": "[email protected]", "shipping": null, "delinquent": false, "metadata": [ ], "subscriptions": { "object": "list", "total_count": 0, "has_more": false, "url": "\/v1\/customers\/cus_6u32tOQ6MRXuqm\/subscriptions", "data": [ ] }, "discount": null, "account_balance": 0, "currency": null, "sources": { "object": "list", "total_count": 0, "has_more": false, "url": "\/v1\/customers\/cus_6u32tOQ6MRXuqm\/sources", "data": [ ] }, "default_source": null } ] }
你能否告诉我们'$客户'全力输出? – arik
现在加入吧,对不起 – Wargog