I am using Laravel 4, with PHP and MySQL. Everything is in UTF-8
I have blog titles stored in my database, that look like :
This is an "example" post title
Now on my website, I have images using alt title attributes.
When I echo my blog title, I get something like:
<img src="image.jpg" alt="This is an "example" post title" />
Which of course is terrible.
I have tried the following:
{{ html_entity_decode($blog_title, ENT_QUOTES, 'UTF-8') }}
But it doesn't seem to do anything. What am I missing?
I would like the title to display like this: This is an "example" post title
I am using 5.7 laravel version. Below solution solved my problem:
<p>{!! $pa_full_desc !!}</p>
here $pa_full_desc has dummy html content eg.
<p>In lobortis pharetra mattis. Morbi nec nibh iaculis, <a href="#">bibendum augue a</a>, ultrices nulla. Nunc velit ante, lacinia id tincidunt eget, faucibus nec nisl.</p>
This worked for me. Thanks for asking this question.
Use triple curly quotes:
{{{ $blog_title }}}
The html_entity_decode() does the opposite (and hence leaves " untouched). As a memory hook:
" -> encoding -> "
" -> decoding -> "
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