Having array in input so formed:
Array
(
[0] => 10
[1] => -1
[2] => -1
[3] => -1
[4] => -1
[5] => 15
[6] => 16
[7] => 17
[8] => -1
[9] => -1
[10] => 20
)
How I can split it for -1 value having as output something so:
Array
(
[0] => 10
[1] => Array
(
[0] => 15
[1] => 16
[2] => 17
)
[2] => Array
(
[0] => 20
)
)
The php explode() function works for string input. While here is something for array.
-1s from the array and leave it otherwise unchanged? It's not quite clear what you need due to the inconsistency in the output.