Store array in while loop to use outside

后端 未结 4 463
星月不相逢
星月不相逢 2021-01-21 15:28

I would like to store value from while loop but not in multidimensional way :

 $movies_id = array();

 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
          


        
4条回答
  •  春和景丽
    2021-01-21 16:33

    I may have misunderstood what you're aiming for, but this might do it:

    replace

    $movies_id[] = [$id => $title_id];
    

    with

     $movies_id[$id] = $title_id;
    

提交回复
热议问题