php - push array into array - key issue

后端 未结 6 1707
春和景丽
春和景丽 2021-02-02 10:19

i am trying to push multiple arrays into 1 big array, resulting in a 2 lvl array.

I got this set of arrays for example:

Array
(
    [cod] => ffffd
    [denum] =         


        
6条回答
  •  既然无缘
    2021-02-02 11:13

    first convert your array too JSON

    while($query->fetch()){
       $col[] = json_encode($row,JSON_UNESCAPED_UNICODE);
    }
    

    then vonvert back it to array

    foreach($col as &$array){
       $array = json_decode($array,true);
    }
    

    good luck

提交回复
热议问题