Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用带有日期错误的if_Php_If Statement - Fatal编程技术网

Php 使用带有日期错误的if

Php 使用带有日期错误的if,php,if-statement,Php,If Statement,我哪里出错了?我做了代码,但不工作,请帮助我任何人,谢谢 <?php $tm = date("H"); $td = date("W"); if ($td != "0" and ($tm >= "8" and $tm <= "22")){ // button ?> <html...> <?php ) ?> 我哪里出错了?在最后一行,你的大括号不好,应该是}而不是 作为奖励,我删除了第四行数字周围的引号。到底出了什么问题?您希望这段代码做什么而它没有

我哪里出错了?我做了代码,但不工作,请帮助我任何人,谢谢

<?php
$tm = date("H");
$td = date("W");
if ($td != "0" and ($tm >= "8" and $tm <= "22")){
// button
?>
<html...>
<?php ) ?>

我哪里出错了?

在最后一行,你的大括号不好,应该是}而不是


作为奖励,我删除了第四行数字周围的引号。

到底出了什么问题?您希望这段代码做什么而它没有做什么?
<?php
$tm = date("H");
$td = date("W");
if ($td != 0 and ($tm >= 8 and $tm <= 22)) {
// button
?>
<html...>
<?php } ?>
      ^^