douyu7879 2016-09-23 07:14
浏览 49
已采纳

在php中从嵌套数组中拆分数组

I am trying to separate an array from a nested array.Any help would be appreciated.

Nested array:

array:1 [▼
  "empid" => array:2 [▼
    0 => "IDE023"
    1 => "IDE025"
  ]
]

I want to split the below array from that

array:2 [▼
  0 => "IDE023"
  1 => "IDE025"
]

How can i do that using PHP ?

  • 写回答

2条回答 默认 最新

  • doufeng2877 2016-09-23 07:18
    关注

    Use array_pop

    $yourArray = array_pop($yourArray);
    

    Note this will disturb the original array. Use only if don't want to use the original array again.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?