从2000年1月1日开始“三天打渔,两天晒网”算,求任意一天打渔还是晒网?
从2000年1月1日开始“三天打渔,两天晒网”算,求任意一天打渔还是晒网?
------解决方案--------------------
<a style="color:#f60; text-decoration:underline;" title="php" href="https://www.php.cn/zt/15714.html" target="_blank">php</a>$s=strtotime('2000-1-1');$time=strtotime('2012-5-11');$sum=($time-$s)/86400;$day=$sum%5;echo $day<font color="#e78608">------解决方案--------------------</font><br>写个函数了。<br><br>function GetText($day){ $nowDay = date("z", strtotime($day)) + 1; Return ($nowDay%5 >= 1 && $nowDay%5 <font color="#e78608">------解决方案--------------------</font><br>计算的不准是因为天数差计算有误<br><br>给个最笨的方法,供你参考。你不是在做作业吗?<br><br>$t = strtotime('2000-1-1');<br>$i = 0;<br>while($t echo date('Y-m-d', $t) . ' '. ($i $t = strtotime('+1 day', $t);<br> $i = ($i+1) % 5;<br>}<br><div class="clear"></div>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号