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 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助