Welcome Guest, Not a member yet? Register   Sign In
changing a collection into an array
#3

Now i have
$stripe = new \Stripe\StripeClient($_SESSION['STRIPE_SECRET_KEY']);
$customersResponse = $stripe->customers->all(['email' => $_SESSION['userid']]);
$customersArray= $customersResponse->data;
$_SESSION['stripe_customer_number'] = (string) $customersArray[0]->_values->id;

$customersArray yields an array of 10 objects (why 10?). But I need to get the _values.id in the first array element. I get a warning of use of undefined constant "_values". How can I "strip" the id out of object[0]? I am getting a warning that "_values" is an undefined constant.

$_SESSION['stripe_customer_number'] = (string) $customersArray[0]->_values->id; contains the string I need.
proof that an old dog can learn new tricks
Reply


Messages In This Thread
changing a collection into an array - by richb201 - 10-06-2022, 01:07 PM
RE: changing a collection into an array - by richb201 - 10-07-2022, 05:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB