0
How we can show on screen two-dimensional array in the form of a table in php?
6 Answers
+ 4
<?php
$group = array(
"online"=> array ("Alex", "Amy"),
"offline"=> array("John","Jack"),
"away"=> array("Anna","Mary")
);
foreach($group as $key => $value){
?>
<table border=1>
<tr>
<th><?php echo $key;?></th>
<td><?php echo $value[0]; ?></td>
<td><?php echo $value[1]; ?></td>
</tr>
</table>
<?php
}
?>
+ 1
Thank you.
What mean "?" in code HTML?
+ 1
<?php?> this is php tag. "?" is the closing of php tag with add >
+ 1
Yes, you can also write it in html for displaying dynamic output like in above example.
+ 1
thank you for your help)
0
I see. And we write this part of code in Html, it's right?