html entities - Decoding full text with PHP -


i have output need decoded, it's passed php page such:

<img src='http://freetopwallpaper.com/wp-content/gallery/puppy-pic/puppy wallpaper-hd-19.jpg' class='blog-image' />lorem ipsum dolor sit amet, consectetur adipiscing elit. morbi augue lorem, semper eget varius non, aliquam vel felis. aliquam erat volutpat. suspendisse pellentesque, ipsum sed vulputate consequat, ligula nisi tincidunt lacus, eget pretium sapien felis sed arcu. vivamus ligula leo, interdum in vestibulum eget, malesuada nec diam. mauris interdum metus vel purus dapibus non feugiat risus ultricies. morbi semper convallis purus @ varius. mauris et lacinia lorem. quisque id lacus sem cartomizer.  <strong>proin facilisis lacus in nisi laoreet rutrum. praesent ligula magna, interdum gravida egestas a, posuere @ ante. sed est neque, rhoncus et mattis in, cursus @ risus. sed in quam purus. mauris vitae dui est, quis consequat lacus. proin mollis congue erat in adipiscing. quisque ultricies pulvinar fringilla. cras vitae quam neque. fusce mattis elit nec lacus volutpat atomizer pretium fermentum sed nisl. proin sed urna non erat blandit feugiat nec non ante. fusce eu diam quis tellus aliquam sodales. vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; morbi vehicula leo ut tellus pulvinar vulputate. donec imperdiet blandit fringilla.</strong> 

when run either html_entities_decode() or htmlspecialchars_decode() it's outputting plain text rather html. in addition, &amp;lt;strong&amp;gt; tags output in original status rather being converted <strong>s.

i've searched, haven't found anything. appreciated.

try:

<?php $buffer = <<<str &lt;img src=&#039;http://freetopwallpaper.com/wp-content/gallery/puppy-pic/puppy wallpaper-hd-19.jpg&#039; class=&#039;blog-image&#039; /&gt;lorem ipsum dolor sit amet, consectetur adipiscing elit. morbi augue lorem, semper eget varius non, aliquam vel felis. aliquam erat volutpat. suspendisse pellentesque, ipsum sed vulputate consequat, ligula nisi tincidunt lacus, eget pretium sapien felis sed arcu. vivamus ligula leo, interdum in vestibulum eget, malesuada nec diam. mauris interdum metus vel purus dapibus non feugiat risus ultricies. morbi semper convallis purus @ varius. mauris et lacinia lorem. quisque id lacus sem cartomizer.  &amp;lt;strong&amp;gt;proin facilisis lacus in nisi laoreet rutrum. praesent ligula magna, interdum gravida egestas a, posuere @ ante. sed est neque, rhoncus et mattis in, cursus @ risus. sed in quam purus. mauris vitae dui est, quis consequat lacus. proin mollis congue erat in adipiscing. quisque ultricies pulvinar fringilla. cras vitae quam neque. fusce mattis elit nec lacus volutpat atomizer pretium fermentum sed nisl. proin sed urna non erat blandit feugiat nec non ante. fusce eu diam quis tellus aliquam sodales. vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; morbi vehicula leo ut tellus pulvinar vulputate. donec imperdiet blandit fringilla.&amp;lt;/strong&amp;gt; str;  echo htmlspecialchars_decode(htmlspecialchars_decode($buffer, ent_quotes)); ?> 

probably you've double-encoded entities somewhere. of php 5.4.5 works.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -