How to find all substrings of a string in PHP

skoto

New Member
I need to convert strings of the form\[code\]"a b c"\[/code\]into arrays of the form\[code\]Array( [0] => a [1] => a b [2] => a b c [3] => b [4] => b c [5] => c)\[/code\]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!
 
Back
Top