dotkpay Posted September 25, 2011 Share Posted September 25, 2011 Hello, Am looking for a function that generates all possible combinations of strings in an array. For example if: $arr[1] = "Hello"; $arr[1] = "how"; $arr[2] = "are"; $arr[3] = "you"; When the array is passed through the function you would come up with a list of string combinations line by line like below: Hello Hello how are you how Hello are you how are Hello you how are you Hello how ........and so on The list goes on and on. Link to comment https://forums.phpfreaks.com/topic/247839-combinations/ Share on other sites More sharing options...
WebStyles Posted September 25, 2011 Share Posted September 25, 2011 what you're looking for are permutations. Do you have any code to show us, so we can try and help, or do you just want someone to do the whole thing for you? Link to comment https://forums.phpfreaks.com/topic/247839-combinations/#findComment-1272647 Share on other sites More sharing options...
dotkpay Posted September 26, 2011 Author Share Posted September 26, 2011 I tried, but all I did was write the array so there is not much to call a starting point Link to comment https://forums.phpfreaks.com/topic/247839-combinations/#findComment-1272743 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.