I am trying to catch bullet points which was given in textfield and trying to replace it with something else, because it is being shown as ? instead of • after rendering the given text to the user. I tested like this: I wrote text with bullet points in word and copy-pasted into textfield.
My vision is this:
$test = strstr($input,'•');
if($test){ echo "bullet point found!";
}
but it is not working or not catching, or • is the wrong regexp to catch the bullet points.
strstris unlikely to catch•when you specify•because the former is a native character, and the latter a HTML entity.It doesn’t matter though: you should fix the underlying issue instead.
You’re likely to have an encoding problem that’s not limited to bullet points. Seeing a � character means that you are feeding a non-UTF-8 character into UTF-8 output.
Reasons for this could be:
A source file (where the character is stored) that is saved in the wrong encoding, e.g. Windows-1252 instead of UTF-8 (check the “Save As…” dialog of your IDE)
A database connection that uses
latin1as the connection encoding (even though the tables are UTF-8)See UTF-8 all the way through for a comprehensive list of things to look at.