string date(string format[, int timestamp])
描述:格式化一个本地时间/日期
format格式:
Y:4位数字完整表示的年份
y:2位数字表示的年份
F:月份,完整的文本格式
M:三个字母缩写表示的月份
m:数字表示的月份,有前导零
n:数字表示的月份,没有前导零
d:月份中的第几天,有前导零
j:月份中的第几天,没有前导零
l:星期几,完整的文本格式
D:星期中的第几天,文本表示,3个字母
w:星期中的第几天,数字表示
H:小时,24小时格式,有前导零
i:有前导零的分钟数
s:秒数,有前导零
int time()
描述:返回当前Unix时间戳
echo time(), “\n”; //当前的时间戳 echo strtotime(’-3 month’), “\n”; //获取之间的时间戳 echo microtime(true), “\n”; 生成唯一的ID
string uniqid(string $prefix =""[, bool m o r e e n t r o p y = f a l s e ] ) 描 述 : 生 成 唯 一 I D , more_entropy = false]) 描述:生成唯一ID, moreentropy=false])描述:生成唯一ID,prefix是前缀
echo uniqid(), “\n”; echo uniqid(time()), “\n”;
echo md5(uniqid(microtime() . mt_rand())), “\n”;