Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/311.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将数组放入并获取数组php_Php_Arrays - Fatal编程技术网

将数组放入并获取数组php

将数组放入并获取数组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

这是我在这里的代码,我正在调用一个返回数组的函数,我有另一个数组$order\u数据,我想把$id的所有值放入这个$order\u数据['sellr\u id']……如果有人知道这个plz,请帮我怎么做

$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