I have an array like this:
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 10 [4] => 11 [5] => 12 [6] => 13 [7] => 14 [8] => 23 [9] => 24 [10] => 25 )
And I want to fill in the blanks so that it looks like this:
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => xxx [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 14 [9] => xxx [10] => 23 [11] => 24 [12] => 25 )
If you look at the values ββof the first array, that is, 1,2,3, and then a space, then 10,11,12,13,14, and then a space, and then 23,24,25 .. How can I programmatically find these spaces and add a new array element in its place
There will be a maximum of two spaces.
I canβt think of a good way to do this, any ideas? Thanks.
source share