PHP中获取今天的时间戳几个方法
php中获取当天的时间戳可以用mktime,date,today几个函数来相互操作来实现了,下面有简单的几个例子
今天0点表示,方法一:
$today = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
方法二:
strtotime(date('Y-m-d', time());
方法三:
strtotime("today");
如果要获取当时间戳只需要使用$time = time() 即可。
教程地址:http://www.phprm.com/base/68631.html
欢迎转载!但请带上文章地址^^