I have a PHP array like below:
Array
(
[0] => 16
[1] => 17
[2] => 18
[3] => 23
[4] => 7
[5] => 6
[6] => 14
[7] => 22
)
I need two split this array in to two arrays by 23 value it will be like below:
Array
(
[0] => 16
[1] => 17
[2] => 18
)
Array(
[0] => 23
[1] => 7
[2] => 6
[3] => 14
[4] => 22
)
Can any one know how to do this with PHP.
The
23in the code below is hardcoded, and the original array will be split only if the23value found in the source array:http://ideone.com/BPn7t
or
if you need to left the found value in the first array