Hello! At the input we have the string "abc", as the output to get an array:
[0] => abc [1] => a,bc [2] => ab,c [3] => a,b,c
The row size is unknown in advance. Thank you in advance!
UPD: Gentlemen, I apologize for the lack of clarity. I will clarify:
At the entrance:
"abcdef"
At the exit:
[0] => abcdef [1] => a,bcdef [2] => ab,cdef [3] => abc,def [4] => abcd,ef [5] => abcde,f [6] => a,b,cdef [7] => a,b,c,def [8] => a,b,c,d,ef [9] => a,b,c,d,e,f [10] => ab,cdef [11] => ab,c,def [12] => ab,c,d,ef [13] => ab,c,d,e,f ... [n] => abc,d,e,f ... [n] => a,bcd,ef [n] => a,bcd,e,f ... [n] => abc,de,f ... [n] => a,bcde,f ...
In general, all possible options where you can insert a comma between the letters