Skip to content
Advertisement

How to echo in PHP, HTML tags

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?

Advertisement

Answer

<?php

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

?>

Just put it in single quotes.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement