【发布时间】:2011-03-06 21:29:19
【问题描述】:
我有一个前缀数组、一个基词数组和一个后缀数组。我想看看可以做出的每一种组合。
例子:
prefixes: 1 2
words: hello test
suffixes: _x _y
Results:
1hello_x
1hello_y
1hello
1test_x
1test_y
1test
1_x
1_y
1
2hello_x
2hello_y
2hello
2test_x
2test_y
2test
2_x
2_y
2
hello_x
hello_y
hello
test_x
test_y
test
_x
_y
y
我该怎么做?
编辑:感谢所有回复,我正在研究解决方案,但似乎如果没有前缀,那么组合将失败。即使没有任何前缀,它仍应通过基本词和后缀。
【问题讨论】:
标签: php arrays combinations permutation