Jump to content

Echo W/C dates


leachus2002

Recommended Posts

When playing with dates, I like to use strtotime in combination with date. Other people like to use other functions.

 

Try:

<?php
$dates = array();
$start = (date('l') == 'Monday')?time():strtotime('last monday');
$add7days = 86400 * 7;
for ($i = 0;$i < 5;++$i) {
  $dates[$i] = date('d/m',$start + ($i * $add7days));
}
echo '<table><tr><td>' . implode('</td><td>',$dates) . '</td></tr></table>';
?>

 

Ken

Link to comment
https://forums.phpfreaks.com/topic/227056-echo-wc-dates/#findComment-1171861
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.