Ben PayPal böyle dönen bir dizi var:
Array
(
[responseEnvelope.timestamp] => 2010-09-07T23%3A06%3A33.737-07%3A00
[responseEnvelope.ack] => Success
[responseEnvelope.correlationId] => b9d9ca4f54f44
[responseEnvelope.build] => 1437064
[estimatedAmountTable.currencyConversionList(0).baseAmount.code] => USD
[estimatedAmountTable.currencyConversionList(0).baseAmount.amount] => 1.00
[estimatedAmountTable.currencyConversionList(0).currencyList.currency(0).code] => EUR
[estimatedAmountTable.currencyConversionList(0).currencyList.currency(0).amount] => 0.71
[estimatedAmountTable.currencyConversionList(0).currencyList.currency(1).code] => USD
[estimatedAmountTable.currencyConversionList(0).currencyList.currency(1).amount] => 1.00
[estimatedAmountTable.currencyConversionList(0).currencyList.currency(2).code] => GBP
[estimatedAmountTable.currencyConversionList(0).currencyList.currency(2).amount] => 0.48
)
Bu yaptığı işlevi:
function _deformat($nvpstr) {
foreach (explode('&', $nvpstr) as $nvp) {
list($key, $value) = explode('=', $nvp);
$data[$key] = $value;
}
return $data;
}
Bu gibi dizi istiyorum:
..
[EUR]
[amount] => 0.71
[GBP]
[amount] => 0.48
...
Ben anahtarını alabilirsiniz:
$ New_key = substr (strrchr ($ key), 1 ".");
ama ben bundan sonra bir spine değilim.