html嵌套php:switch

原创
2016-08-08 09:19:35 1466浏览
转载:http://www.cnblogs.com/glory-jzx/p/3345685.html
If you wan't to use the alternative syntax for switch statements this won't work:

switch($variable): ?> case 1: ?>
Newspage
break;?> case 2: ?>
Forum
break;?> endswitch;?>
Instead you have to workaround like this:
switch($variable): case 1: ?>
Newspage
break;?> case 2: ?>
Forum
break;?> endswitch;?>

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

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

you may see the comment in this link ........http://php.net/manual/en/control-structures.alternative-syntax.php

以上就介绍了html嵌套php:switch,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。