简体   繁体   中英

Php html is printing as it is on the page

I have and html string like this : <div class="short-description"> <h2></h2> <div class="std"><p>This <strong>1-1/2 in by 25 ft. Deluxe In-Ground Pool Vacuum Hose</strong> fits most in-ground residential and commercial pool cleaning applications. The continuous spiral wound construction of the vacuum hose provides excellent flexibility and strength. The smooth spiral design inner wall also allows for maximum efficiency of water flow.</p><br /><p><em>**Color may be blue or grey**</em></p></div> </div> <div class="short-description"> <h2></h2> <div class="std"><p>This <strong>1-1/2 in by 25 ft. Deluxe In-Ground Pool Vacuum Hose</strong> fits most in-ground residential and commercial pool cleaning applications. The continuous spiral wound construction of the vacuum hose provides excellent flexibility and strength. The smooth spiral design inner wall also allows for maximum efficiency of water flow.</p><br /><p><em>**Color may be blue or grey**</em></p></div> </div>

I encoded it using htmlentities and again decoding it using html_entity_decode it decoding successfully but when on the web browser it coming like : "<div></div>" the html is printed out on the page.

I know this is not related to encoding the html is saved in db table any idea on this.

Thanks

You seem to have double-encoded your entities. Post the PHP code if you can't figure it out, but it looks like you are encoding an already html-entity-encoded string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM