b_hole
04-01-2007, 08:42 AM
Hi,
I get a string from a form, and I need to manipulate it, and create an array containing all the results.
- If the string has 1 word, the array should contain 1 element with the same word.
- If the string has 2 words, the array should contain 2 elements, looking like this: [0] => "word1word2", [1] => "word1-word2"
- If the string has 3 words, the array should contain 4 elements, looking like this: [0] => "word1word2word3", [1] => "word1-word2word3", [2] => "word1word2-word3", [3] => "word1-word2-word3"
- If the string has 4 words, the array should contain 8 elements, looking like this: [0] => "word1word2word3word4", [1] => "word1-word2word3word4", [2] => "word1word2-word3word4", [3] => "word1word2word3-word4", [4] => "word1-word2-word3word4", [5] => "word1-word2word3-word4", [6] => "word1word2-word3-word4", [7] => "word1-word2-word3-word4"
- etc.
Hope you get the point...
I'm trying to figure out a to handle this, buy I can't think of how to do it.
What do you guys think? Any help would be appreciated.
Thanks.
I get a string from a form, and I need to manipulate it, and create an array containing all the results.
- If the string has 1 word, the array should contain 1 element with the same word.
- If the string has 2 words, the array should contain 2 elements, looking like this: [0] => "word1word2", [1] => "word1-word2"
- If the string has 3 words, the array should contain 4 elements, looking like this: [0] => "word1word2word3", [1] => "word1-word2word3", [2] => "word1word2-word3", [3] => "word1-word2-word3"
- If the string has 4 words, the array should contain 8 elements, looking like this: [0] => "word1word2word3word4", [1] => "word1-word2word3word4", [2] => "word1word2-word3word4", [3] => "word1word2word3-word4", [4] => "word1-word2-word3word4", [5] => "word1-word2word3-word4", [6] => "word1word2-word3-word4", [7] => "word1-word2-word3-word4"
- etc.
Hope you get the point...
I'm trying to figure out a to handle this, buy I can't think of how to do it.
What do you guys think? Any help would be appreciated.
Thanks.