Answer the question
In order to leave comments, you need to log in
PHP how to filter out unwanted UTF-8 characters in a text string?
The essence of the problem: there is an arbitrary input text variable, where various obscenities can fall: emoticons, special characters, and so on, because of which further output in the browser may result in a mess.
Googled various solutions, tried all available, for example from here https://stackoverflow.com/questions/1176904/php-ho...
Options such as
Or
preg_replace( '/[^[:print:]]/'
filter_var($input, FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH);
Answer the question
In order to leave comments, you need to log in
further output in the browser may result in porridgewhat does porridge mean?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question