Aliaga Aliyev

1

votes
0

answer
20

views

How to create dynamic combination with php?

I have 3 array like $arr = [ 'color' => [['name'=>'red']], 'size' => [['name'=>'18 inch'], ['name'=>'15 inch']], 'type' => [['name'=>'plastic']] ] $combo = array(); foreach ($arr['size'] as $size) { foreach($arr['color'] as $color){ foreach ($arr['type'] as $type) { $variant = json_encode(['size' =...
Aliaga Aliyev