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条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度