RE: [PHP] Adding time
| From: | Dunaway, Brian | Date: | Wed, 25 Oct 2000 22:08:22 +0000 |
| Subject: | RE: [PHP] Adding time | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-21946@lists.php.net to get a copy of this message | ||
> i am trying to make a table that lists the hours of a day.
> -----------------
> |12:00 | 1:00 |
> ----------------- and so on
>
> HOW to add the hour in the loop?
>
>Alan
on one row?
starting at 1am?
12hour or 24hour?
// One Row Based On 12Hour Clock (am/pm) Starting At 1:00AM
print("<table border=\"1\">\n");
print("\t<tr>\n");
$xm = "am";
$two = 0;
while($two <= 1)
{
for($i=1;$i<=12;$i++)
{
print("\t\t<td>$i:00 $xm</td>\n");
}
$xm = "pm";
$two++;
}
print("\t</tr>\n");
print("\t</table>\n");
-briand