Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.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_Codeigniter - Fatal编程技术网

Php 组合数组

Php 组合数组,php,arrays,codeigniter,Php,Arrays,Codeigniter,在我的输出中,代码如下所示: Array ( [0] => 53,67,70 [1] => 48 [2] => 11,22,13 ); 我希望输出为:数组(11,22,13,48,53,67,70) 在我的数据库表中,行如下:(json数据) 第1行:[“11,22,13”] 第2行:[“48”] 第3行:[“53,67,70”] 如何将php代码固定为数组(11,22,13,48,53,67,70)。修正了,但仍然有错误,请参见:第132行是这

在我的输出中,代码如下所示:

Array ( 
    [0] => 53,67,70
    [1] => 48 
    [2] => 11,22,13 
);
我希望输出为:数组(11,22,13,48,53,67,70)

在我的数据库表中,行如下:(json数据)

第1行:[“11,22,13”]
第2行:[“48”]
第3行:[“53,67,70”]


如何将php代码固定为
数组(11,22,13,48,53,67,70)
。修正了,但仍然有错误,请参见:第132行是这样的:
$out=array\u merge($out,explode(',',$dv))?对,我明白了。。请查看更新后的答案是否适用于您。
    $result = $this->db->get_where('table',array('mainpage'=>$mp'));
    $data = array();
    $out = array();
    foreach($result->result() as $row){
        $dv = json_decode($row->subpage);
        $out = array_merge($dv, $out);
    }
    return    $out;
$result = $this->db->get_where('table',array('mainpage'=>$mp));
$data = array();
$out = array();

foreach($result->result() as $row){
        $dv = json_decode($row->subpage);

        $flat = array();

        foreach ( $dv as $item ) {
            $flat = array_merge( $flat, explode( ',', $item ) );
        }

        $out = array_merge( $out, $flat );
}

return $out;
$array = array (array (53, 67, 70), array (48), array (11, 22, 13));
$combined_array = call_user_func_array ('array_merge', $array);