PHP - MySQL data is html code and php doesn't show correctly -


i have values in database column named description contains html code ex. (<p>&nbsp;</p><div class="col-xs-8">..).

i database rows , try show in page, columns displays normal (as plain text) when echo variable contains description value doesn't turn code "page", shows code.

where problem? shouldn't consider code , add page?

code:

<div class="info">    <div class="info-space" style="width: 800px;"></div>         <?php             echo $pro_desc;         ?>     </div> </div> 

your $pro_desc looks this:

string '&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;col-xs-8&quot;...length(25000) 

in order display correctly, need convert html format, example &lt;p&gt; <p> , on. try this:

echo "<p>".html_entity_decode($pro_desc)."</p>"; 

more info: http://php.net/manual/en/function.html-entity-decode.php


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -