标签'?php'是不允许的

I am new to AMP and am trying to build a new AMP page. I wanted to include PHP but I am getting this error:-

The tag '?php' is disallowed.

<?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();

?>

At the end of the line you have get();?> this ?> seems accidental or is out of place. It‘s advised to always put your closing tag on a new line so you see them better when you have multiple php parts mixed with other parts of code that use a different language or are hard typed output.

<?php
  // do something parsed by php
?>
  do something without php
<?php
  // do something parsed by php
?>
  do something without php

The <?php tag opens a new block of PHP code. Before you can open another php block, you have to close the previous script with the php close tag: ?>.

Since you didnt do that, and have multiple occurances of <?php it generates an error.