PHP语法错误,意外'''[关闭]

edit: this is due to content not requiring parsing as php.

I have a very basic webpage that doesn't seem to like my google tracking code. My web server renders

PHP message: PHP Parse error: syntax error, unexpected '<'"

referring to the first <script> line. I am really unable to see how it thinks there is an extra "<" in there. If I replace the script content with echo "blah";, the page renders fine.

<html>
<body>
<?php
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-gwryhaehsd', 'auto');
  ga('send', 'pageview');

</script>
?>
</body>
</html>

Remove the <?php and ?> before and after your <script> tag.

It's because you've surrounded your Google Analytics tracking script with <?php ?> tags. Remove them and it'll work.