Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Here is a basic HTML table -->
- <table>
- <tr>
- <th>ID</th>
- <th>Name</th>
- <th>Power Rating</th>
- <th>Created on</th>
- </tr>
- <!-- A foreach loop creates an array that we can then use to loop through -->
- <?php foreach ($records as $record) : ?>
- <tr>
- <!-- Replace id, name and price with your own column headings from your table -->
- <td><?php echo $record['id']; ?></td>
- <td><?php echo $record['name']; ?></td>
- <td><?php echo $record['price']; ?>%</td>
- <!-- Here is the PHP date function in action, you can change d F Y to suit your project -->
- <td><?php echo date('d F Y', strtotime($record['date-created'])); ?></td>
- </tr>
- <?php endforeach; ?>
- </table>
Add Comment
Please, Sign In to add comment