Created
May 21, 2018 16:56
-
-
Save sebgates/84c37beeecd5318f88cdb734feb4ee3a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment