$str = "A 'quote' is <b>bold</b>"; // Output: A 'quote' is <b>bold</b> echo htmlentities($str);
Example from the official website, why when I use it, the page still displays A 'quote' is bold instead of the content in the comment
走同样的路,发现不同的人生
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
<?php $str = "A 'quote' is <b>bold</b>"; // 输出: A 'quote' is <b>bold</b> echo htmlentities(htmlentities($str)).'<br>';
https://zhidao.baidu.com/ques...
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
https://zhidao.baidu.com/ques...