Anyone can tell me why this return to the array to string conversation when I decoding it. I didn't see any error for this type of JSON.
{"transaction":{"token":"8mBjEEGt0E7QxhZoObDb8Jy0gSH","created_at":"2019-12-22T04:42:23Z","updated_at":"2019-12-22T04:42:24Z","succeeded":true,"transaction_type":"AddPaymentMethod","retained":false,"state":"succeeded","message_key":"messages.transaction_succeeded","message":"Succeeded!","payment_method":{"token":"TRYA1r9WQ0u8jllrJVHRjYyBOIh","created_at":"2019-12-22T04:42:23Z","updated_at":"2019-12-22T04:42:24Z","email":"fstancereq@virginia.edu","data":null,"storage_state":"cached","test":false,"metadata":null,"callback_url":null,"last_four_digits":"2214","first_six_digits":"475129","card_type":"visa","first_name":"Fleur","last_name":"Stancer","month":8,"year":2022,"address1":"46 Meadow Ridge Drive","address2":null,"city":"Orlando","state":"FL","zip":"32885","country":"US","phone_number":null,"company":null,"full_name":"Fleur Stancer","eligible_for_card_updater":true,"shipping_address1":null,"shipping_address2":null,"shipping_city":null,"shipping_state":null,"shipping_zip":null,"shipping_country":null,"shipping_phone_number":null,"payment_method_type":"credit_card","errors":[],"fingerprint":"fb8a1c8ddfb37ad4810335243495109596aa","verification_value":"XXX","number":"XXXX-XXXX-XXXX-2214"}}}
when I decode it using json_decode
echo $json["transaction"]["payment_method"];
I seek for the same problem but I didn't get an answer.