Hello,
here is the code:
<?
$a=array(1,2,3, 4,5,6,7,8,9,10) ;
$b=array(1,3,5, 7,9);
$c=array(1,1,2, 2,3,3);
$d=array_count_ values($b);
$e=array_count_ values($c);
foreach($a as $key)
echo '<table><tr><td >'.$key.'</table></tr></td>';
foreach($d as $key=>$value)
echo '<table><tr><td >'.$key.'<td>'. $value.'</table></tr></td>';
foreach($e as $key=>$value)
echo '<table><tr><td >'.$key.'<td>'. $value.'</table></tr></td>';
?>
the result will be :
1
2
3
4
5
6
7
8
9
10
1 1
3 1
5 1
7 1
9 1
1 2
2 2
3 2
how can I formulate a php code to insert all in the same html table, like
this :
1 1 1 1 2
2 3 1 2 2
3 5 1 3 2
4 7 1
5 9 1
6
7
8
9
10
Thank you.
here is the code:
<?
$a=array(1,2,3, 4,5,6,7,8,9,10) ;
$b=array(1,3,5, 7,9);
$c=array(1,1,2, 2,3,3);
$d=array_count_ values($b);
$e=array_count_ values($c);
foreach($a as $key)
echo '<table><tr><td >'.$key.'</table></tr></td>';
foreach($d as $key=>$value)
echo '<table><tr><td >'.$key.'<td>'. $value.'</table></tr></td>';
foreach($e as $key=>$value)
echo '<table><tr><td >'.$key.'<td>'. $value.'</table></tr></td>';
?>
the result will be :
1
2
3
4
5
6
7
8
9
10
1 1
3 1
5 1
7 1
9 1
1 2
2 2
3 2
how can I formulate a php code to insert all in the same html table, like
this :
1 1 1 1 2
2 3 1 2 2
3 5 1 3 2
4 7 1
5 9 1
6
7
8
9
10
Thank you.
Comment