php - push array into array - key issue

后端 未结 6 1711
春和景丽
春和景丽 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条回答
  •  梦毁少年i
    2021-02-02 11:04

    $res_arr_values = array();
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
    {
        $res_arr_values[] = $row;
    }
    
    
    array_push == $res_arr_values[] = $row;
    
    example 
    
     orange
        [1] => banana
        [2] => apple
        [3] => raspberry
    )
    ?>
    

提交回复
热议问题