php教程|php手册
thinkphp代码,代码示例,代码参考,php短信,数据库备份代码,令牌验证,去除代码中的空白和注释lastweek
php教程-php手册
/**
* 获取当前时间上一周的开始时间和结束时间,可以通过配置一周的开始时间,默认为星期一
* @param
*$begin 上一周开始时间的变量名称;
*$end 上一周结束时间的变量名称;
*$week_start_num 一周的开始时间,默认为周一
*$now_time 当前时间,这里做一个当前时间方便测试该方法的正确性
* @return array()
* @author leeyi
行政审批 源码,vscode会跨域拦截吗,vnc使用ubuntu,tomcat适合版本下载,scraping爬虫文件,php试题库管理系统,seo优化具体怎么做收录lzw
* 获取当前时间上一周的开始时间和结束时间,可以通过配置一周的开始时间,默认为星期一 * @param * $begin 上一周开始时间的变量名称; * $end 上一周结束时间的变量名称; * $week_start_num 一周的开始时间,默认为周一 * $now_time 当前时间,这里做一个当前时间方便测试该方法的正确性 * @return array() * @author leeyi * @spec * 使用方法,执行 * extract(get_lastweek(eginLastweek,endLastweek)); * 之后,可以直接使用 $beginLastweek $endLastweek 两个变量; * 如果需要其他变量名称,可以修改参数 $begin 和 $end ,自行指定名称 * @end */ function get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=1, $now_time=\) { $now_time = $now_time>0 ? $now_time : time(); $now_weekday = date(w, $now_time); // 获取当前是星期前 0-6 星期日-星期六 $week_start_num = in_array($week_start_num, array( ,1,2,3,4,5,6)) ? $week_start_num : 1; // 默认一周开始时间为周一 $now_weekday= $now_weekday<$week_start_num ? $now_weekday+7 : $now_weekday; //php获取上周起始时间戳和结束时间戳 $beginLastweek = $now_time-($now_weekday+7-$week_start_num)*86400; $endLastweek = $beginLastweek+(6*86400); echo date(Y-m-d,$now_time). : .date(Y-m-d 00:00:00, $beginLastweek). => .date(Y-m-d 23:59:59, $endLastweek). ; // for test return array( $begin=> strtotime(date(Y-m-d 00:00:00, $beginLastweek)), $end=> strtotime(date(Y-m-d 23:59:59, $endLastweek)) ); } get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=0, strtotime(-03-23)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=0, strtotime(-03-24)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=0, strtotime(-03-25)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=0, strtotime(-03-26)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=0, strtotime(-03-27)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=0, strtotime(-03-28)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=0, strtotime(-03-29)); echo 天龙八部帐号注册源码,vscode反向撤销,ubuntu wget,tomcat 加证书,sqlite3改时区,jquery二维码扫描插件,有哪些关于前端框架的网站,怎么用爬虫设置自动回复,PHP取文件后缀名,禅城seo优化价格,手机版b2b网站模板,网页时间加速器,app界面模板下载lzw ; get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=1, strtotime(-03-22)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=1, strtotime(-03-23)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=1, strtotime(-03-24)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=1, strtotime(-03-25)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=1, strtotime(-03-26)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=1, strtotime(-03-27)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=1, strtotime(-03-28)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=1, strtotime(-03-29)); echo 贴吧源码,vscode的图片怎样链接进去,ubuntu 不能复制,tomcat能挂两个,sqlite 连接VB,网页设计培训视频教程,怎样选择网站服务器,商城网站代码插件,前端框架对比angular,杭州抖音爬虫,php生成随机字母,seo关键词搜索, mvc 网站源码,手机网页表白源码,淘宝客单页模板,网站500页面模板,商城管理系统源码,vc 画图程序lzw ; get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=2, strtotime(-03-22)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=2, strtotime(-03-23)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=2, strtotime(-03-24)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=2, strtotime(-03-25)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=2, strtotime(-03-26)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=2, strtotime(-03-27)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=2, strtotime(-03-28)); get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=2, strtotime(-03-29)); exit();/**
下面是测试代码 :get_lastweek($begin=eginLastweek,$end=endLastweek,$week_start_num=0, strtotime(-03-22));
浏览器输出结果:
-03-22 : -03-15 00:00:00 => -03-21 23:59:59
-03-23 : -03-15 00:00:00 => -03-21 23:59:59
-03-24 : -03-15 00:00:00 => -03-21 23:59:59
-03-25 : -03-15 00:00:00 => -03-21 23:59:59
-03-26 : -03-15 00:00:00 => -03-21 23:59:59
-03-27 : -03-15 00:00:00 => -03-21 23:59:59
-03-28 : -03-15 00:00:00 => -03-21 23:59:59
-03-29 : -03-22 00:00:00 => -03-28 23:59:59
-03-22 : -03-09 00:00:00 => -03-15 23:59:59
-03-23 : -03-16 00:00:00 => -03-22 23:59:59
-03-24 : -03-16 00:00:00 => -03-22 23:59:59
-03-25 : -03-16 00:00:00 => -03-22 23:59:59
-03-26 : -03-16 00:00:00 => -03-22 23:59:59
-03-27 : -03-16 00:00:00 => -03-22 23:59:59
-03-28 : -03-16 00:00:00 => -03-22 23:59:59
-03-29 : -03-16 00:00:00 => -03-22 23:59:59
-03-22 : -03-10 00:00:00 => -03-16 23:59:59
-03-23 : -03-10 00:00:00 => -03-16 23:59:59
-03-24 : -03-17 00:00:00 => -03-23 23:59:59
-03-25 : -03-17 00:00:00 => -03-23 23:59:59
-03-26 : -03-17 00:00:00 => -03-23 23:59:59
-03-27 : -03-17 00:00:00 => -03-23 23:59:59
-03-28 : -03-17 00:00:00 => -03-23 23:59:59
-03-29 : -03-17 00:00:00 => -03-23 23:59:59
AD:真正免费,域名+虚机+企业邮箱=0元