处理mysql用now()生成的时间 不指定

Else , 2008/02/15 01:07 , 代码片段,演示也有 , Comments(2) , Reads(4769) , Via Original
php处理mysql用now()生成的时间

  function getMonthDay($str)
  {
    $str=explode(" " ,$str);
    $str=explode("-" ,$str[0]);
    return $str[1]."-".$str[2];
  }

在做php的时候,我喜欢用now生成时间,
但是用date取不了月日,于是写了一个
Tags: , ,
Else Email Homepage
2008/04/08 01:47
在一次用到这个函数,支持一下
wxxslt
2008/02/15 16:47
可以月日呀shockshockshock
Else replied on 2008/02/15 17:20
比如2008-03-01 12:12:12
先用空格分成兩個數組原素
然後在用"-"分
取1和2就是月份和天數
Pages: 1/1 First page 1 Final page
Add a comment

Nickname

Site URI

Email

Enable HTML Enable UBB Enable Emots Hidden Remember [Login] [Register]