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));
string(31) "Hot & Cold and On & Off"
CodePad.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With