【发布时间】:2019-08-02 07:54:31
【问题描述】:
感谢您的帮助,但我在这里找到了答案:PHP, Get tomorrows date from date
我的问题可能很简单,但我在任何地方都找不到答案。我希望打印某些东西是否打开。正如您在代码中看到的那样,它是一个有效的检查器,但它是今天检查,而不是明天检查。我需要做什么才能让它在第二天而不是今天检查?
谢谢
<?php
date_default_timezone_set('Europe/Oslo');
$dag = date("l");
$uke = date("W");
$åpent = "Nei";
if ($dag == "Monday") {
$åpent = "Nei";
} else if ($dag == "Wednesday") {
$åpent = "Ja! (17-22)";
} else if ($dag == "Thursday") {
$åpent = "Ja! (17-22)";
} else if ($dag == "Friday") {
$åpent = "Ja! (18-00:30)";
} else if ($dag == "Saturday") {
$åpent = "Nei";
} else if ($dag == "Sunday") {
$åpent = "Nei";
}
if ($uke % 2 == 0) {
$åpent = "Ja! (17-21)";
} else {
$åpent = "Nei";
}
echo $åpent;
?>
评论的问题不符合我的需要。我正在寻找一种让 PHP 在第二天以date("l") 形式打印的方法。
【问题讨论】:
-
@Alexis 我看到了这个帖子,但它不符合我的要求。
标签: php date datetime dayofweek weekday