如何从多维数组组合中实现所有可能的组合-PHP

时间:2019-05-14 18:36:32

标签: php arrays combinations

例如,我有以下数组:

  "product" => array:1 [
    0 => "32"
  ]
  "partner" => array:2 [
    0 => "32"
    1 => "66"
  ]
  "affiliate" => []
  "sub_id" => []
]

并且我希望能够实现所有可能的组合,所以最终我将需要这样的东西:

   0 => [
        "product": 32,
        "partner": 32
   ],
   1 => [
        "product": 32,
        "partner": 66
   ]
]```

0 个答案:

没有答案