A
A
Arman2019-02-20 12:42:42
PHP
Arman, 2019-02-20 12:42:42

How to cut out such characters?

I don’t know for sure whether it will show here or not, in general, there is a symbol between the letters a and b:
ab
Twitter swears at him. Most likely it came from some doc-document.
So far, I just made a cut through str_replace, but maybe there is something more correct?
Maybe there is a way to cut out such garbage?
before showing, use html_entity_decode and htmlspecialchars

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2019-02-20
@Arik

This is a zero-width non-breaking space that is also used as a BOM tag.
www.fileformat.info/info/unicode/char/feff/index.htm
It's not quite clear which characters you are going to strip. There are quite a lot of invisible and difficult to distinguish characters, it is usually easier to leave the "correct" ones, deleting everything else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question