如何在 PHP、HTML 标签中回显

2022-01-18 00:00:00 tags php html echo

我在发帖之前经历了这个:

如何在 PHP 中回显 HTML?

我仍然无法让它工作.

我试图回应这个:

<h3><a href=<#></a></h3><div>Lorem ipsum dolor sit amet.</div></div>

但我仍然找不到将标签设为"的方法.和''消失.我该怎么办?

解决方案

只需将其放在单引号中即可.

I went through this before posting:

How can I echo HTML in PHP?

And I still couldn't make it work.

I'm trying to echo this:

<div>
    <h3><a href="#">First</a></h3>
    <div>Lorem ipsum dolor sit amet.</div>
    </div>
<div>

But I still can't find a way to make the tags "" and '' disappear. What do I have to do?

解决方案

<?php

echo '<div>
 <h3><a href="#">First</a></h3>
 <div>Lorem ipsum dolor sit amet.</div>
</div>
<div>';

?>

Just put it in single quotes.

相关文章