Code Example
<html>
<head>
<title>Array</title>
</head>
<body>
<?php
$marks=array("Tom"=>array("Eng"=>45,"Maths"=>42,"Sc"=>46),"Pit"=>array("Eng"=>42,"Maths"=>41,"Sc"=>47),"John"=>array("Eng"=>46,"Maths"=>44,"Sc"=>46));
?>
<table align="center" cellspacing="10">
<tr>
<th>Name</th>
<th>English</th>
<th>Maths</th>
<th>Science</th>
</tr>
<tr>
<td>Tom</td>
<td><?php echo $marks['Tom']['Eng']?></td>
<td><?php echo $marks['Tom']['Maths']?></td>
<td><?php echo $marks['Tom']['Sc']?></td>
</tr>
<tr>
<td>Pit</td>
<td><?php echo $marks['Pit']['Eng']?></td>
<td><?php echo $marks['Pit']['Maths']?></td>
<td><?php echo $marks['Pit']['Sc']?></td>
</tr>
<tr>
<td>John</td>
<td><?php echo $marks['John']['Eng']?></td>
<td><?php echo $marks['John']['Maths']?></td>
<td><?php echo $marks['John']['Sc']?></td>
</tr>
</table>
</body>
</html>
No comments:
Post a Comment