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 ........

PHP错误 。Parse error: syntax error, unexpected T_INLINE_HTML, expecting T_ENDSWITCH or T_CASE or T_DEFAULT的更多相关文章

  1. PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法

    出现这个错误的原因就是语法错误,肯定是PHP程序的书写不规范造成,PHP语句标识符错了,没有在php.ini中开启短标签!八成是这个原因,啊啊啊! 今天在写PHP程序的时候总是出现这样的错误:Pars ...

  2. PHP关于syntax error语法错误的问题(Parse error: syntax error, unexpected end of file in xxxxxxxx)

    在php程序出现类似 Parse error: syntax error, unexpected end of file in xxxxxxxx  on line xx 的错误. 如图 如果发现php ...

  3. Parse error: syntax error, unexpected T_PUBLIC in 问题解决

    class 类中 public function _getInfo($sn){        $title = '';        $_array = explode('~', $sn);      ...

  4. *2 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected '[' in /application/nginx-1.6.3/html/zabbix/index.php on line 32" while reading response header from upstream, clien

    今天呢想学习一下zabbix监控一下我的服务情况,然后就开始安装我的zabbix服务,首先LNMP环境准备好了,Nginx版本为1.6.3,php版本为5.3.27,MySQL版本为二进制包安装的5. ...

  5. Parse error: syntax error, unexpected end of file in *.php on line * 解决方法

    Parse error: syntax error, unexpected end of file in *.php on line * 解决方法   这篇文章主要介绍了PHP错误Parse erro ...

  6. Parse error: syntax error, unexpected '__data' (T_STRING), expecting ',' or ')'

    使用laravel时,建立view文件引入dafault文件时报错: Parse error: syntax error, unexpected '__data' (T_STRING), expect ...

  7. Parse error: syntax error, unexpected 'class' (T_CLASS)

    电脑坏了重新下载代码. 结果报错 Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_ST ...

  8. 页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久总算解决了

    页面白屏并且报错PHP Parse error:  syntax error, unexpected end of file in 试了很久 啥短标记,打开,都试了 最简单的办法 是重新建立一个文件, ...

  9. 使用帝国备份王软件提示 Parse error: syntax error, unexpected end of file

    使用帝国备份王软件提示 Parse error: syntax error, unexpected end of file时, 可以尝试一下方法: 1.php.ini要把short_open_tag ...

随机推荐

  1. e783. 监听对JList中项双击和三击

    // Create a list String[] items = {"A", "B", "C", "D"}; JLis ...

  2. C# ?? 运算符是什么?

    ?? 运算符定义在将可空类型分配给非可空类型时返回的默认值. int? c = null; //若 c 为 null,则 d 为 -1,否则把 c 值赋予 dint d = c ?? -1;

  3. (转)编译android5.1,添加swap分区的方法

    clang++: error: unable to execute command: Killedclang++: error: assembler command failed due to sig ...

  4. log4net 日志配置及使用

    一.log4net按照不同的[LEVEL]级别输出到不同文件 <log4net> <!--错误日志:::记录错误日志--> <!--按日期分割日志文件 一天一个--> ...

  5. [linux]Error: failure: repodata/repomd.xml from fedora: [Errno 256] No more mirrors to try.

    在使用fedora17 系统的yum源的时候出现了例如以下错误: Error: failure: repodata/repomd.xml from fedora: [Errno 256] No mor ...

  6. js scrollIntoViewIfNeeded

    根据 MDN的描述,Element.scrollIntoView()方法让当前的元素滚动到浏览器窗口的可视区域内. 而Element.scrollIntoViewIfNeeded()方法也是用来将不在 ...

  7. js 事件详解 冒泡

    起因:正常情况下我点击s2时是先弹出我是children,再弹出我是father,但是却出现了先弹出我是father,后弹出我是children的情况,这种情况是在和安卓app交互的h5页面中出现的, ...

  8. 解决错误:“废弃 document 元素之后的内容”——HTML5新特性,局部样式表

    最近正在学习angularjs,不过本文和angularjs没多大关系.在学习使用route和ng-view使用模版之后,发现view装载之后,firefox都会报个错误“废弃 document 元素 ...

  9. Android SDK Content loader has encountered a problem” “parseSdkContent Failed ”

    昨天做了一个Android的小程序,调试的时候连接真实的手机,而不是用模拟器.今天早上打开eclipse的时候报错:“Android SDK Content loader has encountere ...

  10. dubbo开发前戏--ZooKeeper集群部署(3.4.6)

    最近在开发dubbo服务的时候一直用的是公司提供的zk平台,因为使用的人太多或者没人维护老是出问题,导致dubbo服务偶尔可以调通,偶尔调不通的情况,所以花点时间自己部署一套,后面出问题还方便看日志排 ...