dsm0688 2017-05-19 10:25
浏览 31
已采纳

如何重新索引多维数组的子数组?

I have this array that I want it reformatted to produce another array without the array_keys in it. Here is the original array and the desired array.

The original Array

Array
(
    [0] => Array
        (
            [id] => 75
            [date] => 2017-05-18
            [time] => 11:15:00
            [dist_id] => ss0001
            [order_no] => SS17137111520
            [paid_amount] => 0
            [balance] => 0
            [status] => peding
        )

    [1] => Array
        (
            [id] => 76
            [date] => 2017-05-18
            [time] => 16:34:00
            [dist_id] => ss0001
            [order_no] => SS17137043422
            [paid_amount] => 0
            [balance] => 0
            [status] => peding
        )        
)

The Expected Array

Array
(
    [0] => Array
        (
            [0] => 75
            [1] => 2017-05-18
            [2] => 11:15:00
            [3] => ss0001
            [4] => SS17137111520
            [5] => 0
            [6] => 0
            [7] => peding
        )

    [1] => Array
        (
            [1] => 76
            [2] => 2017-05-18
            [3] => 16:34:00
            [4] => ss0001
            [5] => SS17137043422
            [6] => 0
            [7] => 0
            [8] => peding
        )
)
  • 写回答

3条回答 默认 最新

  • duanliao6077 2017-05-19 10:32
    关注

    Hope this single line will be helpful.

    Try this code snippet here

    $array=array_map('array_values', $array);
    print_r($array);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?