はじめまして!!
現在以下のようなオブジェクトから、自由にデータを抽出しようと考えているのですが、なかなか上手くいきません。
lang
1{ 2 "intent": "sale", 3 "payer": { 4 "payment_method": "paypal", 5 "payer_info": { 6 "shipping_address": { 7 8 } 9 } 10 }, 11 "transactions": [ 12 { 13 "amount": { 14 "total": "2500", 15 "currency": "JPY", 16 "details": { 17 "subtotal": "2500" 18 } 19 }, 20 "description": "Payment description", 21 "invoice_number": "略", 22 "item_list": { 23 "items": [ 24 { 25 "name": "sample", 26 "price": "2500", 27 "currency": "JPY", 28 "quantity": "1" 29 } 30 ] 31 }, 32 "related_resources": [ 33 34 ] 35 } 36 ] 37}
下記のようなコードでトライして結果、salesのみ抽出出来ました。
この場合どのような処置をとればよいでしょうか?
何かご存知の方は、是非ともご教授の程よろしくお願い申し上げます。
lang
1//前後のコード省略 2echo $response->intent; 3echo $response->transactions->description; 4echo $response-> transactions; 5
sale
Notice: Trying to get property of non-object in 略
Notice: Array to string conversion in 略 Array
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/06/12 03:56
2015/06/12 04:39
2015/06/12 04:51