stated array getting set of combinations....please help me and let me know how to save list of record into mysql database.....database contains three fields (set1 set2 set3)...
regards,
$array1 = array('rough', 'smooth', 'coarse');
$array2 = array('shiny', 'matte', 'rough');
$array3 = array('very large', 'large', 'medium', 'small');
$array=array_merge($array1,$array2,$array3);
$combinations=array();
for($x=0;$x<(count($array)-2);$x++) {
$a=$array[$x];
for ($y=$x+1;$y<count($array);$y++) {
$b=$array[$y];
for ($z=$y+1;$z<count($array);$z++) {
$c=$array[$z];
$combinations[]="$a, $b, $c";
}
}
}