How to echo in PHP, HTML tags

Trufa picture Trufa · Oct 14, 2010 · Viewed 118.4k times · Source

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?

Answer

William Macdonald picture William Macdonald · Oct 14, 2010
<?php

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

?>

Just put it in single quotes.