I'm trying to use htmlspecialchars_decode() but it don't decoding
into spaces. Are any solutions of this problem?
My code:
$query = mysql_query("select * from nowosci order by id desc limit 0,3");
while($rekord = mysql_fetch_array($query))
{
$tekst .= '<h1 class="body"><div class="date" style="display:inline; color:grey; margin-right:5px;">'.$rekord[3].'</div>'.html_entity_decode($rekord[1]).'</h1><div class="main">'.html_entity_decode($rekord[2]).'</div>';
}
echo $tekst
Use html_entity_decode()
instead.
htmlspecialchars_decode()
only decodes & " (when ENT_NOQUOTES is not set), ' (when ENT_QUOTES is set), < and >.
htmlspecialchars_decode()
decodes htmlspecialchars
and it's not supposed decode
as this does not belong to htmlspecialchars
. you can look at htmlspecialchars list.
you can use html_entity_decode();
instead.
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