How to stop an html TEXTAREA from decoding html entities

后端 未结 6 1277
眼角桃花
眼角桃花 2021-01-01 12:46

I have a strange problem:

In the database, I have a literal ampersand lt semicolon:

<div  

whenever its printed into a html

6条回答
  •  我在风中等你
    2021-01-01 13:01

    In PHP, this can be done using htmlentities(). Example below.

    ". htmlentities($content) ."";
    ?>
    

    Without htmlentities(), the textarea would interpret and display the TM symbol (™) instead of "™".

    http://php.net/manual/en/function.htmlentities.php

提交回复
热议问题