从php echo语法输出html吗?

问题描述 投票:0回答:1

我有一个PHP邮件程序脚本,该脚本在表格上方的div上输出一条消息:

// Send the email.
if (mail($recipient, $subject, $email_content, $email_headers)) {
// Set a 200 (okay) response code.
http_response_code(200);
echo "Thank You! Your message has been sent.";
}

我想在回显中添加样式和换行符,但是当前这是使用标签而不是代码输出的:

echo "<span>Thank You!</span><br />Your message has been sent.";

我也尝试过将双引号更改为单引号,但这没有用。

php html syntax echo
1个回答
0
投票

尝试使用<? php echo <span>Thank You!</span><br />Your message has been sent ?>

© www.soinside.com 2019 - 2024. All rights reserved.