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?
Using echo or print: PHP echo or print can be used to display HTML markup, javascript, text or variables.
In PHP, you will use echo to output one or more expressions. It's important to understand that echo is not a function but is a language construct. The arguments echo accepts are a list of expressions separated by commas. Unlike other language constructs, echo does not have a return value.
The strip_tags() function strips a string from HTML, XML, and PHP tags. Note: HTML comments are always stripped. This cannot be changed with the allow parameter. Note: This function is binary-safe.
<?php
echo '<div>
<h3><a href="#">First</a></h3>
<div>Lorem ipsum dolor sit amet.</div>
</div>
<div>';
?>
Just put it in single quotes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With