我有一阵从Pal公司返回:
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
)
这一职能是:
function _deformat($nvpstr) {
foreach (explode( & , $nvpstr) as $nvp) {
list($key, $value) = explode( = , $nvp);
$data[$key] = $value;
}
return $data;
}
我希望这样的阵列:
..
[EUR]
[amount] => 0.71
[GBP]
[amount] => 0.48
...
我可以找到关键之处:
美元:新元=子(主,,“......”);
之后,一把一根 flat子 in。