日期:2014-05-16  浏览次数:20359 次

php基础
编写一个函数,使它可以根据传入的指定年周号字符串(如201205)和偏移周数(如25表示后25周,或-25表示前25周)来返回新的年周号字符串.
------解决方案--------------------
<?php
date_default_timezone_set('Asia/Shanghai');

$timestamp =  strtotime('2014 + 10 week -20 week');
echo  '2014年第10周减20周的结果是:'.date('Y年W周',$timestamp);
echo  ',timestamp是'.$timestamp;
?>