SCREAM:错误抑制被忽略(!)解析错误:语法错误,C:\wamp\www\tests\Variables.php 中的意外“<”在第 12 行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14077753/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 06:34:48  来源:igfitidea点击:

SCREAM: Error suppression ignored for ( ! ) Parse error: syntax error, unexpected '<' in C:\wamp\www\tests\Variables.php on line 12

php

提问by john doe

im learning php and im watching some lynda tutorials. i have installed wamp server and i get these errors:

我正在学习 php,我正在看一些 lynda 教程。我已经安装了 wamp 服务器,但出现以下错误:

( ! ) SCREAM: Error suppression ignored for ( ! ) Parse error: syntax error, unexpected '<' in C:\wamp\www\tests\Variables.php on line 12

( ! ) SCREAM:错误抑制被忽略 ( ! ) 解析错误:语法错误,C:\wamp\www\tests\Variables.php 中第 12 行出现意外的“<”

with this simple code

用这个简单的代码

<html>
<head>
    <title>Basic</title>
</head>
<body>
<?php 
$var1 = 10;
echo $var1;
$my_variable = "hllo world";
$my_Variable = "Hello w0rld";
echo $my_Variable;
<br />
$var1 = 100;
echo $var1;
?>
</body>
</html> 

and i think im getting this because i have html tag in the php tag, when i remove the html tag from php and put it outside php tag it works...

我想我得到这个是因为我在 php 标签中有 html 标签,当我从 php 中删除 html 标签并将其放在 php 标签之外时,它可以工作...

回答by radek

You cannot use html tags inside php tag, so just

您不能在 php 标签中使用 html 标签,所以只需

echo('<br/>');

or split PHP tags like

或拆分 PHP 标签,如

?>
<br/>
<?php