0

how to split received values of an array into a new array?

so from this:

[["+","+","+"],["-","+","+"],["*","+","+"],["\/","+","+"],

to this:

["+"],["+"],["+"],["-"],["+"],["+"],["*"],["+"],["+"],

can someone help me?

vdhmartijn
  • 106
  • 2
  • 11

1 Answers1

1

Flatten your array by looping through it

$aFlattened = array();
foreach($aOriginalArray AS $aOperators){
   $aFlattened = array_merge($aFlattened, $aOperators);
}
Sajuna Fernando
  • 1,364
  • 9
  • 16