I have this …
symbol showing up on my page instead of ...
and I tried to use both to see if it's in the string using:
echo $matches[$indexN];
if (strpos($matches[$indexN], "…") === false && strpos($matches[$indexN], "...") === false) {
echo "false";
}
The output of $matches[$indexN]:
…
The output of the if statement:
false
What am I doing wrong?
… is the ANSI interpretation of an ellipsis (…) encoded in UTF-8. An ellipsis is one character, whereas it looks like you are passing three (three periods) to strpos
. Incidentally, when working with a multibyte encoding such as UTF-8, you'll need to use mb_strpos
instead.