06011991
06011991

Reputation: 807

Split an array from nested array in 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 ?

Upvotes: 0

Views: 61

Answers (2)

jitendrapurohit
jitendrapurohit

Reputation: 9675

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.

Upvotes: 1

JemoeE
JemoeE

Reputation: 600

$split_array = $original_array['empid'];

Upvotes: 0

Related Questions