I\'m accessing customer data from the Stripe API, which I\'d like to convert to JSON. Usually I\'d convert an object to an array and use json_encode() but I don
json_encode()
On the latest version, You can use echo $customer->toJSON(); to get the output as JSON.
echo $customer->toJSON();