0
我有這種結構的數組:通過多維數組迭代
Array (
[0] => Array ([key] => Egg Method [values] => Array (
[0] => Array ([id] => 1 [value] => Boiled)
[1] => Array ([id] => 2 [value] => Poached)
[2] => Array ([id] => 3 [value] => Fried)
[3] => Array ([id] => 4 [value] => Scrambled)))
[1] => Array ([key] => Bread [values] => Array (
[0] => Array ([id] => 5 [value] => White)
[1] => Array ([id] => 6 [value] => Brown)))
[2] => Array ([key] => Egg Hardness [values] => Array (
[0] => Array ([id] => 7 [value] => Soft)
[1] => Array ([id] => 7 [value] => Medium)
[2] => Array ([id] => 8 [value] => Hard)))
)
我怎麼會通過陣列輸出所有可能的排列的重複,即
另外一個問題我不知道可能有多少個標準數組,所以不幸的是,我不能僅僅爲此使用3個嵌套循環。
我使用PHP,但我猜想一個僞代碼解決方案將會很好,我可以適應它。
如果只有生活是如此簡單。這不僅會輸出類似 煮/白 煮/布朗 水煮/白 等等等等 感謝無論如何,我管理一個整潔的遞歸函數來解決它。 – BigMeat