1
我的文字:在PHP從文本獲取特定的變量值
//Stores DAta In Text Variable
$text = '{"id":"pay_6ixRYfJxUGVVB5","entity":"payment","amount":1100000,"currency":"INR","status":"authorized","order_id":null,"international":false,"method":"card","amount_refunded":0,"refund_status":null,"captured":false,"description":"Yamaha F310, 6-Strings Acoustic Guitar, Natural","card_id":"card_6ixRZh03lD6ch7","bank":null,"wallet":null,"vpa":null,"email":"[email protected]","contact":"+917863495210","notes":{"address":"446\/3\/1, Lake Miami,
Calfiornia, USA.
Pincode: 121212. India."},"fee":null,"service_tax":null,"error_code":null,"error_description":null,"created_at":1479573225}';
我怎麼能取的amount
的價值$amount
變量?
echo $amount variable.
這是行得通的。但是,當我使用相同的過程來獲取地址等其他值時,它不會提供任何結果。你能告訴我如何獲取地址值嗎? –
創建JSON對象後,您只需引用該JSON密鑰即可。看我的編輯。出於某種原因,您的地址碼是另一個JSON對象,因此您必須先引用註釋。 – TheValyreanGroup