在php回声中转义html标签

时间:2017-02-16 12:30:55

标签: javascript php html

我有一个AJAX联系表单,在成功消息中我想添加html标签,但是当我这样做时,它会打印标签,因此它显示为......

  <p>Thank You! You are unsubscribed.</p>

我该如何修改以下内容?

    if (mail($recipient, $subject, $email_content, $email_headers)) {
        http_response_code(200);
        echo '<p>Thank You! You are unsubscribed.</p>';
    } else {
        http_response_code(500);
        echo "Oops! Something went wrong and we couldn't send your message.";
    }

它看起来并不像How to echo in PHP, html tags

那么容易

我无法集成document.write

0 个答案:

没有答案