php - 不允许使用标签“?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();
?>
解决方案
该<?php
标记打开一个新的 PHP 代码块。在您可以打开另一个 php 块之前,您必须使用 php 关闭标记关闭前一个脚本:?>
。
由于您没有这样做,并且多次出现<?php
它会产生错误。
推荐阅读
- symfony - 如何在 Symfony 5 中从一个数据库表渲染表单并 POST 到另一个数据库表
- c# - 如何在 c# c sharp 中创建一个二维数组 [n,3] 从用户那里获取字符串输入
- ffmpeg - 使用 ffmpeg 创建一个黑色背景的音乐视频
- vimeo - 即使视频可用,也为 vimeo api 获取 404?
- image - Spring内容,如何在其他页面获取图片
- python - 提取包含列名或表条目中特定字符串的熊猫数据框
- azure-devops - Azure 开发运维。通过运行时变量定义变量组
- python-3.x - 如何在 Python 中将函数放入列表中?
- java - Android片段被另一个片段覆盖
- sass - 如何使用 Vaadin 7 和 maven 编译其他非主题 SCSS 文件