date函数可用于返回通过提供整数时间戳或当前时间(如果未提供时间戳)而指定的格式格式的字符串
时间戳是可选的,默认值为time()。
if(date('j', $timestamp) === '1')
echo "It is the first day of the month today\n";
if(date('D', $timestamp) === 'Mon')
echo "It is Monday today\n";输出结果
这将产生以下输出-
It is the first day of the month today