If you wan't to use the alternative syntax for switch statements this won't work:

<div>
<?php switch($variable): ?>
<?php case 1: ?>
<div>
Newspage
</div>
<?php break;?>
<?php case 2: ?>
</div>
Forum
<div>
<?php break;?>
<?php endswitch;?>
</div>

Instead you have to workaround like this:

<div>
<?php switch($variable): 
case 1: ?>
<div>
Newspage
</div>
<?php break;?>
<?php case 2: ?>
</div>
Forum
<div>
<?php break;?>
<?php endswitch;?>
</div>

 

看了半天原来是PHP 的BUG。。。 唉。。。

 switch : 和 case 之间是不能有任何输出的。。。  PS : 一个空格也不行。。 

you may see the comment in this link ........

相关文章:

  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2022-02-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2021-06-10
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案