我使用下面的 php 从给定的周数和年份获取工作日:
$week_number = 42;
$year = 2014;
for($day = 1; $day<=7; $day++)
{
echo date('m/d/Y',strtotime($year."W". $week_number.$day));
}
输出看起来像这样:
10/13/2014
10/14/2014
10/15/2014
10/16/2014
10/17/2014
10/18/2014
10/19/2014
我怎样才能让它看起来像这样:
Oct 13 - Oct 19.
谢谢你。