使用PHP

时间:2019-11-01 04:37:14

标签: php arrays

我有以下查询循环查询选择记录

$shopchairs=$rows['shop_chairs'];  //coming dynamically  i.e. 1 or 3 or 4 
$result = [];
for($i=1;$i<=$shopchairs;$i++)
{
    $query = //SELECT QUERY WITH WHERE CONDITION;
    $res = $query->result_array();
    $result[] = [
    'chairnumber' => $i,
    'status' => $querys->num_rows() > 0 ? 'booked' : 'available',
    'estimateTime' => "",
    ];

}
echo "<pre>";print_R($result);

现在我只想将来自$ res(array)的“ estimateTime”与$ result(array)合并,该怎么办? 现在我的$ res在循环中显示以下数组

Array
(
    [0] => Array
        (
            [shopId] => 2
            [duration] => 20
            [estimatedTime] => 11.3000
        )
)
Array
(
)
Array
(
)
Array
(
)

我只想将EstimatedTime与$ result数组合并

0 个答案:

没有答案