Permutations of an array of arrays of strings

前端 未结 5 851
鱼传尺愫
鱼传尺愫 2021-02-10 02:07

I simply cannot wrap my head around how to solve this problem and after a thorough search on Google with no results, I turn to you with hopes of a solution.

Given the sa

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-10 02:41

    for ($i = 0; i < sizeof($Type); $i++) {
      for ($j = 0; j < sizeof($Size); $j++) {
         for ($k = 0; k < sizeof($Colour); $k++) {
           echo $Type[i] . $Size[j] . $Colour[k];
         }
      }
    }
    

提交回复
热议问题