echo date('Y-m-01',strtotime('2003-3-4')).'----'.date('Y-m-t',strtotime('2003-3-4'))

解决方案 »

  1.   

    一个月的第一天不用得到的吧;-)
    最后一天:date('t');一个月的总天数,就是最后一天啦
      

  2.   

    strtotime:参数为GNU标准时间格式,返回时间戳
    不知道楼主的DB是什么:
    在Oracle里面,可以这样:
    select name from table where to_char(BirthDate,'mm') = to_char(sysdate,'mm');
      

  3.   

    就是在数据库里面将数据过滤掉,而不用PHP程序处理:
    select name from table where to_char(BirthDate,'mm-dd') = to_char(sysdate,'mm-dd');