php - 关于htmlentities的显示
怪我咯
怪我咯 2017-05-16 13:05:25
0
5
732
$str = "A 'quote' is bold"; // 输出: A 'quote' is <b>bold</b> echo htmlentities($str);

官网的例子,为什么我使用的时候,页面上还是显示A 'quote' isbold而不是注释里的内容

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all (5)
过去多啦不再A梦

If it’s just this piece of code, there will be no problem running it!

It depends on whether you have other codes that are affected

    曾经蜡笔没有小新

    Right click -> View web page source code

      为情所困

      Press F12 > Network > Response to view the parameters of the link response. The default browser will escape the ascii code for you.

        淡淡烟草味

        There is no problem with the running result because this kind of string ‘<’ is parsed by the browser; if you really want to output it like this

        bold"; // 输出: A 'quote' is bold echo htmlentities(htmlentities($str)).'
        ';
          洪涛

          https://zhidao.baidu.com/ques...

            Latest Downloads
            More>
            Web Effects
            Website Source Code
            Website Materials
            Front End Template
            About us Disclaimer Sitemap
            php.cn:Public welfare online PHP training,Help PHP learners grow quickly!