如何使用PHP获得所选日期的一周? [英] How to get a day of the week for a selected date using PHP?

查看:100
本文介绍了如何使用PHP获得所选日期的一周?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

如何在php中查找星期几

我想得到所选日期的星期几。例如05/19/2011 = 星期四

I want to get the day of the week of the selected date. For example 05/19/2011 = Thursday

推荐答案

>当前时间:

Here's how to do it for the current time:

$day=strftime("%A",time());

或在特定日期:

$day=strftime("%A",strtotime("2011-05-19"));

这篇关于如何使用PHP获得所选日期的一周?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆