我正在尝试将数组
转换为从 xml 转换的字符串数组
[ChargeableRateInfo] => Array(
[NightlyRatesPerRoom] => Array
(
[NightlyRate] => Array
(
[0] => Array()
[1] => Array()
[0_attr] => Array(
[promo] => false
[rate] => 182.46
[baseRate] => 182.46
)
[1_attr] => Array(
[promo] => false
[rate] => 182.46
[baseRate] => 182.46
)
[2] => Array()
)
)
)
我的尝试是:
foreach ($my_array['ChargeableRateInfo']['NightlyRatesPerRoom'] ['NightlyRate'] as $rates){
print_r($rates['1_attr']['baseRate']);
}
我使用 xml2array 将带有属性的 xml 转换为数组