php基础,该如何解决

WBOY
Release: 2016-06-13 11:51:55
Original
806 people have browsed it

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

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!