3

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?

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

3 Comments

i mean 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
@Julianto I'm not sure what you mean sorry :(
i am trying to display language string using htmlentities. echo htmlentities($lang_name, ENT_COMPAT, 'UTF-8', false); above code will display var $name if module mod_charset_lite is enabled. If mod_charset_lite is off, it will display nothing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.