I need to convert strings of the form
"a b c"
into arrays of the form
Array
(
[0] => a
[1] => a b
[2] => a b c
[3] => b
[4] => b c
[5] => c
)
Does PHP provide a native function for converting strings into all substrings? If not, what's the path of least resistance for getting all substrings? Is there a straightforward way to perhaps explode() the string, and use an array op to generate all [ordered] permutations?
Cheers!