这篇文章主要介绍了php求今天、昨天、明天时间戳的方法,实例分析了strtotime函数的常见使用技巧,非常简单实用,需要的朋友可以参考下
具体如下:
echo strtotime('now'),'<br>';//现在
echo strtotime('today'),'<br>';//今天
echo strtotime('tomorrow'),'<br>';//明天
echo strtotime('yesterday'),'<br>';//昨天运行结果如下:
1469674869
1469664000
1469750400
1469577600
立即学习“PHP免费学习笔记(深入)”;
今天剩余的秒数:
echo $time_remain = strtotime('tomorrow') - time();
//输出:75531总结:以上就是本篇文的全部内容,希望能对大家的学习有所帮助。
相关推荐:
以上就是php实现求今天、昨天、明天时间戳的方法的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号