首页 > 解决方案 > 不允许使用标签“?php”

问题描述

我是 AMP 新手,正在尝试构建一个新的 AMP 页面。我想包括 PHP,但我收到了这个错误:-

不允许使用标签“?php”。

<?php $otherCourse= \App\Course::orderBy("order_seq","ASC")->where('status','=',0);
    $otherCourse=$otherCourse->Where(function ($query) {
        $query->orwhere('show_menu', '=',  '2');
        $query->orwhere('show_menu', '=',  '12');
    })->select(DB::raw("group_concat(id) as tid"),'course_name')->groupBy('course_name')->get();

?>

标签: phpamp-html

解决方案


<?php标记打开一个新的 PHP 代码块。在您可以打开另一个 php 块之前,您必须使用 php 关闭标记关闭前一个脚本:?>

由于您没有这样做,并且多次出现<?php它会产生错误。


推荐阅读