Cartesian Product of multiple arrays associate with existing array php

已关闭 已发布的 5 年前 货到付款
已关闭 货到付款

I want to generate a form table with all combinations between attribute and attribute values.

I use possible_combs() - function to generate them

function possible_combos($groups, $prefix='') {

$result = array();

$group = array_shift($groups);

foreach($group as $selected) {

if($groups) {

$result = array_merge($result, possible_combos($groups, $prefix .$selected.', '));

} else {

$result[] = [

'combination_string' => $prefix.$selected,

];

}

}

return $result;

}

BUT, i want to associate product_id for existing combs.

I want to know the logic behind this, how can i merge or find in comb_string to know when combination has product_id and when i have to create new one by adding product_id - 0.

HTML JavaScript MySQL PHP 软件构架

项目ID: #19000616

关于项目

2个方案 远程项目 活跃的4 年前

有2名威客正在参与此工作的竞标,均价$40/小时

utkarshkatiyar19

Hi I'm an expert in php programming. I'm sure that I can easily do this project. We can have a about it. Thanks..

$50USD 在1天里
(49条评论)
5.5