将数组放入并获取数组php
这是我在这里的代码,我正在调用一个返回数组的函数,我有另一个数组$order\u数据,我想把$id的所有值放入这个$order\u数据['sellr\u id']……如果有人知道这个plz,请帮我怎么做将数组放入并获取数组php,php,arrays,Php,Arrays,这是我在这里的代码,我正在调用一个返回数组的函数,我有另一个数组$order\u数据,我想把$id的所有值放入这个$order\u数据['sellr\u id']……如果有人知道这个plz,请帮我怎么做 $sellr_id=$this->model_checkout_getdistanceofseller->getdistanceofseller1($order_data); foreach($sellr_id as $id){ ec
$sellr_id=$this->model_checkout_getdistanceofseller->getdistanceofseller1($order_data);
foreach($sellr_id as $id){
echo'got id'.$id;
}
//echo"seller id array".$sellr_id[0];
//echo"seller id array".$sellr_id[1];
$order_data['sellr_id']=$sellr_id;
查看array_merge(),我想这就是您需要的。我想将所有id放入$order_data['sellr_id']更新您的问题,并添加适当的数据样本和预期结果,请
$sellr_id = $this->model_checkout_getdistanceofseller->getdistanceofseller1($order_data);
$order_data['sellr_id'] = $sellr_id