我有以下對象。在這種情況下,我怎樣才能得到GrossAmount(1.10)的價值作爲變量?如何將名爲_(下劃線)的對象存入變量
我曾嘗試:
$gross = $object->GrossAmount->_;
而$id = $object->GrossAmount->currencyID;
確實給我的GBP
當前代碼但是這是行不通的。
Array
(
[TransactionID] => 9BBXH1113VA716445A
[ParentTransactionID] =>
[ReceiptID] =>
[TransactionType] => express-checkout
[PaymentType] => instant
[PaymentDate] => 2013-02-28T18:26:43Z
[GrossAmount] => stdClass Object
(
[_] => 1.10
[currencyID] => GBP
)
[FeeAmount] => stdClass Object
(
[_] => 0.21
[currencyID] => GBP
)
[TaxAmount] => stdClass Object
(
[_] => 0.00
[currencyID] => GBP
)
[ExchangeRate] =>
[PaymentStatus] => Completed
[PendingReason] => none
[ReasonCode] => none
)
大嘗試,謝謝! – Chris 2013-02-28 18:42:11