1. function getdays($day){
  2. $lastday=date('Y-m-d',strtotime("$day Sunday"));
  3. $firstday=date('Y-m-d',strtotime("$lastday -6 days"));
  4. return array($firstday,$lastday);
  5. }
  6. print_r(getdays('2012-06-2'));

PHP获得指定日期所在星期的第一天和最后一天的更多相关文章

  1. MSSQL 获取指定日期所在星期的第一天和最后一天日期 获取指定日期坐在月的第一天和最后一天

    ufn_GetWeekFirstAndEndDay    获取指定日期所在星期的第一天和最后一天日期 ALTER FUNCTION [dbo].[ufn_GetWeekFirstAndEndDay]( ...

  2. PHP获得指定日期所在月的第一天和最后一天

    function getdays($day){ $firstday = date('Y-m-01',strtotime($day)); $lastday = date('Y-m-d',strtotim ...

  3. php获取指定日期所在星期的开始时间与结束时间

    function getWeekRange($date){    $ret=array();    $timestamp=strtotime($date);    $w=strftime('%u',$ ...

  4. c# 获取某日期所在周的第一天和最后一天

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WyfC ...

  5. c# 获取某日期所在周的第一天和最后一天(转)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WyfC ...

  6. java Calendar Date 获取指定日期所在月或年的第一天和最后一天

    一.获取传入日期所在月的第一天 public static Date getFirstDayDateOfMonth(final Date date) { final Calendar cal = Ca ...

  7. PHP获取指定日期是星期几的实现方法

    这篇文章主要介绍了PHP获取指定日期是星期几的实现方法,涉及php针对日期的读取.判断与字符串.数组相关运算操作技巧,需要的朋友可以参考下 本文实例讲述了PHP获取指定日期是星期几的实现方法.分享给大 ...

  8. PHP:获取指定日期所在月的开始日期与结束日期

    /** * 获取指定日期所在月的开始日期与结束日期 * @param string $date * @param boolean 为true返回开始日期,否则返回结束日期 * @return arra ...

  9. R语言两种方式求指定日期所在月的天数

                 R语言两种方式求指定日期所在月的天数 days_monthday<-function(date){ m<-format(date,format="%m& ...

随机推荐

  1. php面试题12(多态web服务器共享session的方法:将session存到数据库)($val=&$data[$key];)

    php面试题12(多态web服务器共享session的方法:将session存到数据库)($val=&$data[$key];) 一.总结 1.多态web服务器共享session的方法: ...

  2. php实现把数组排成最小的数(核心是排序)(看别人的代码其实也没那么难)(把php代码也看一下)(implode("",$numbers);)(usort)

    php实现把数组排成最小的数(核心是排序)(看别人的代码其实也没那么难)(把php代码也看一下)(implode("",$numbers);)(usort) 一.总结 核心是排序 ...

  3. php如何利用标准输入输出实现在一个字符串中计算某个字符出现的个数?

    php如何利用标准输入输出实现在一个字符串中计算某个字符出现的个数? 一.总结 php实现计算字符个数(php标准输入和输出:fgets(STDIN)  echo $output;) 1.php标准输 ...

  4. 【poj3468】A Simple Problem with Integers

    Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 97008   Accepted: 30285 Case Time Limi ...

  5. 解决“不是有效的win32应用程序”问题

    http://blog.csdn.net/shuaihj/article/details/17096903

  6. [Ramda] Refactor a Promise Chain to Function Composition using Ramda

    Promise chains can be a powerful way to handle a series of transformations to the results of an asyn ...

  7. 理解Erlang/OTP - Application

    http://www.cnblogs.com/me-sa/archive/2011/12/27/erlang0025.html 1>application:start(log4erl). 我们就 ...

  8. Expression Blend 的点滴(3)--Templating的妙用,制作自己的ScrollBar控件

    原文:Expression Blend 的点滴(3)--Templating的妙用,制作自己的ScrollBar控件 在Blend中,有一个功能,Make into control---通过它可以方便 ...

  9. mysql半同步复制实现

    mysql半同步复制和异步复制的区别如上述架构图所看到的:在mysql异步复制的情况下.Mysql Master Server将自己的Binary Log通过复制线程传输出去以后,Mysql Mast ...

  10. Thermal management in a gaming machine

    BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to wager gaming ...