简体   繁体   中英

PHP Htmlentities - double encoded

What condition we use to decide when to set double encoded is true or false? What php settings variable we can use to decide it?

For Russian character, it should use double encoded true then it will display the character. But if double encoded is false, the string will be displayed as empty. What condition we use to set double encoded true or false?

You can change that with the 4th argument. Set it to FALSE to not double encode.

$str = 'Hot & Cold and On & Off';

var_dump(htmlentities($str, ENT_COMPAT, 'UTF-8', FALSE));

Output

string(31) "Hot & Cold and On & Off"

CodePad .

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