my array is Array ( [0] => 652, 5850 [1] => 230, 9850 [2] => 201 ,13700 )
我使用此代码存储这些数据
$myarray=array();
if(!empty($_GET['check_list'])) {
// Loop to store and display values of individual checked checkbox.
foreach($_GET['check_list'] as $selected) {
$myarray[]=$selected;
}
print_r($myarray);
}
我想提取这些数据,如
[roomno] =>652,230,201
[price] =>5850,9850,13700
我怎样才能获得这个价值..感谢先进的
答案 0 :(得分:2)
这是一种可能的方式:
<?php
$array = [
0 => [652, 5850],
1 => [230, 9850],
2 => [201 ,13700]
];
$roomno = [];
$price = [];
foreach($array as $a){
$roomno[] = $a[0];
$price[] = $a[1];
}