<?php
$users=[
[
'id'=> 1,
'name'=> 'وحید',
'family'=> 'صالحی',
'email' => 'va.salehi@gmail.com'
],
[
'id'=> 2,
'name' => 'الهام',
'family' =>'احمدی',
'email' =>'elham@gmail.com'
],
[
'id'=> 3,
'name' => 'سارا',
'family' =>'حمیدی',
'email' =>'sara@gmail.com'
],
[
'id'=> 4,
'name' => 'پدرام',
'family' =>'بهرامی',
'email' =>'bahrami@gmail.com'
],
[
'id'=> 5,
'name' => 'عرفان',
'family' =>'کریمی',
'email' =>'erfan@gmail.com'
]
]
?>
<!DOCTYPE html>
<html>
<style>
table, th, td {
border:1px solid black;
}
</style>
<title>HTML with PHP</title>
<body>
<h1>My Example</h1>
<h2>A basic HTML table</h2>
<table style="width:100%">
<?php foreach ($users as $user) : ?>
<tr>
<th><?php echo $user['id'] ?></th>
<th><?php echo $user['name'] ?></th>
<th><?php echo $user['family'] ?></th>
<th><?php echo $user['email'] ?></th>
</tr>
<?php endforeach;?>
</table>
<p>To understand the example better, we have added borders to the table.</p>
</body>
</html>