“回声"问题在PHP中 [英] problem with "echo" in php

查看:68
本文介绍了“回声"问题在PHP中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好:)我只是想尝试在php中尝试一些事情,顺便说一下,这是基本的东西"echo",这是代码

hello :) i just wanned to try something in php, by the way it''s the basic thing, "echo" , here is the code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

	echo "Ce script envoie un mail à " ;	
?>


</body>
</html>




当我使用wampserver运行它时,出现此错误
解析错误:语法错误,意外T_CONSTANT_ENCAPSED_STRING

因此,如果有人可以帮助我,请谢谢:)




when i run it with wampserver , i have this error
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

so please if someone could help me, thank you :)

推荐答案

我测试了此代码-可以正常工作.

我只有一个问题:字符à"需要Unicode.您在文件中正确规定了字符集,但是您是否以UTF-8编码保存了文件?如果您做错了,则无论如何都不会导致此错误消息.检查:也许您部署和运行的文件与问题中的代码不同?

—SA
I tested this code — it works as expected.

I have only one question: The character ''à'' needs Unicode. You correctly prescribed the charset in the file, but did you save your file in UTF-8 encoding? If you did it wrong, it would not cause this error message anyway. Check up: maybe the file you deployed and ran and the code in your question are different?

—SA


感谢回答Smile |微笑:)
但是我尝试了一条不同的消息,像这样


<!DOCTYPE html PUBLIC-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns ="http://www.w3.org/1999/xhtml">
< head>
< meta http-equiv ="Content-Type" content ="text/html; charset = utf-8"/>
< title>无标题的文档</title>
</head>

< body>

<?php

回声"xxxxxxxxxxx";

?>

</body>
</html>


错误仍然很不幸..
我什至尝试过简单的棚< ''''> ,而不是< ">
感谢您的帮助
thanks for answering Smile | Smile | :)
but i tried a different message, like this


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<?php

echo "xxxxxxxxxxx" ;

?>

</body>
</html>


the error still the same unfortunatly ..
i even tried the simple cote < '' '' > , instead of < " " >
thanks for helping


这篇关于“回声"问题在PHP中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆