2

I have an array like following.

array(1) {
  ["foo"]=>
  array(2) {
    [1]=>
    string(5) "abcde"
    [2]=>
    string(4) "pqrs"
   }
}

now I want to convert it into following

array(2) {
  [1]=>
  string(5) "abcde"
  [2]=>
  string(4) "pqrs"
}

How can I achieve that?

1 Answers1

3

I hope this will do the job:

$oneDimensionalArray = call_user_func_array('array_merge', $twoDimensionalArray);

Please have a look at array_merge.

Kiran Dash
  • 4,816
  • 12
  • 53
  • 84