我想从main获取子数组的值。以下是我的数组。
[tour_avaibility] => Array
(
[tour_avaibility_location] => Array
(
[Location_one] => Location_two
[Location_seven] => Location_nine
)
[tour_avaibility_date] => Array
(
[02/11/2020] => 02/17/2020
[02/21/2020] => 02/26/2020
)
)
我想要通过一个循环来获取价值。我使用了以下代码,但它重复值。'tour_avaibility_location'tour_avaibility_date
<?php
foreach ($tourAvaibilityDate['tour_avaibility'] as $key => $value) {?>
<div class="other-tag justify-content-between">
<?php
foreach ( array_unique($tourAvaibilityLocation['tour_avaibility']['tour_avaibility_location'] ) as $k => $v) {?>
<div class="tag-name"><?php echo $k.$v; ?></div>
<?php }?>
<?php
foreach ( array_unique($tourAvaibilityDate['tour_avaibility']['tour_avaibility_date'] ) as $k => $v) {?>
<div class="tag-price">25 Nov 2019 - 30 Nov 2019</div>
<?php } ?>
<div class="tag-remove text-light">
<i class="fa fa-times"></i>
</div>
</div>
<?php } ?>
我想放出去喜欢..
Location_one - Location_two 02/11/2020 - 02/17/2020
Location_seven - Location_nine 02/21/2020 - 02/26/2020
慕码人8056858