HTML,PHP - Escape '<' and '>' symbols while echoing

后端 未结 8 1918
旧巷少年郎
旧巷少年郎 2020-12-02 00:15

I want to print following text as it is:

echo \"

But it is just showing \'AAAAA\' as output.

How can I esca

8条回答
  •  醉酒成梦
    2020-12-02 00:38

    Use HTML entities: < for < and > for >. Could be achieved using htmlspecialchars function: http://php.net/htmlspecialchars.

    Read more about HTML entities here: http://www.santagata.us/characters/CharacterEntities.html

提交回复
热议问题