I am a teacher that uses HTML to provide simulations for my students. The simulations have a chronological date time line. Every time I want to use the simulation I have to go in and change all the dates to keep the realistic time line. I started reading about php and what to change the dates dynamically. My simulations on on a local server and do not go outside my class room.
Since dates appear many times in my simulations on many different pages, I am looking for code that works in with the fewest lines of code. The code will almost always be in a table cell.
This simple example works for yesterday's date.
Thank you for any suggestions....Waubain
Since dates appear many times in my simulations on many different pages, I am looking for code that works in with the fewest lines of code. The code will almost always be in a table cell.
This simple example works for yesterday's date.
Code:
<body>
<?php
date_default_timezone_set("America/Chicago");
$today = time();
$day = 86400 ;
?>
<table>
<tr>
<td><?php
$newdate = $today - ($day *1);
echo date("m/d/y", $newdate);
?>
</td>
</tr>
</table>
</body>
Thank you for any suggestions....Waubain