i have a simple code
data :
$data1 = array('1','2','3','4');
$data2 = array('1','2','3','4');
$data3 = array('1','2','3');
Logic :
for($a = 0; $a < count($data1); $a++){
for($b = 0; $b < count($data2); $b++){
for($c = 0; $c < count($data3); $c++){
echo $data1[$a].$data2[$b].$data3[$c].'<br>';
}
}
}
in this sample total data is 3, if i have 4 data how to build logic will generate automatically
Above code is static and fixed only for 3 array inputs if there is a condition and the $data
would be more than 3 then it will not work, so how can I use the code for more or less than 3 data variables
For example, If the input data is like,
$data1 = array('1','2','3','4');
$data2 = array('1','2','3','4');
$data3 = array('1','2','3');
$data4 = array(5,6);
$data5 = array(7,8);
Then how to use the loops
in that case.
";} array_pop( $d ); }}listData( $lists ); ?>` – Rohan Kumar Oct 01 '13 at 06:10