Skip to content
Advertisement

HTMLENTITIES doesn’t work with cyrillics

How can I make htmlentities to work with cyrillic symbols. Now, when I try input some cyrillic: “Тест” it returns “Теє My code: $var = htmlentities($var); Encoding: utf-8. Thanks!

Advertisement

Answer

In order to bring closure to this question –

I want my users not to enter HTML code in their comments

This is not necessary; htmlspecialchars() will convert all special characters necessary to prevent HTML from being shown.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement