<Rates>
<Rate EffectiveDate="2011-12-15"> <Total AmountAfterTax="155" /> </Rate>
<Rate EffectiveDate="2011-12-16"> <Total AmountAfterTax="155" /> </Rate>
<Rate EffectiveDate="2011-12-17"> <Total AmountAfterTax="155" /> </Rate>
</Rates>
我目前使用foreach循环创建此行:
$request->Reservation['Rates'] = "";
foreach($Array['Rates'] as $Value)
{
$request->Reservation['Rates']['Rate']
= array("EffectiveDate" => $value['Date']);
$request->Reservation['Rates']['Rate']['Total']
= array("AmountAfterTax" => $value['Price']);
}
答案 0 :(得分:0)
您是否尝试过制作一系列费率?
$request->Reservation['Rates'] = "";
$Length = count($Array['Rates']);
for ($i = 0; $i < $Length; $i++)
{
$request->Reservation['Rates'][$i]['Rate']
= array("EffectiveDate" => $Array['Rates']['Date']);
$request->Reservation['Rates'][$i]['Rate']['Total']
= array("AmountAfterTax" => $Array['Rates']['Price']);
}