I have a page that is working fine, but after users input a text in one form they sometimes use " or ’ and when I clear all the input fields to sanitize I get the ascii code instead. Not sure where this is done, but I just donut want to change too much in my old script. So, instead I thought it is better to just replace the ones I know they usually write and make this before inserting into the db.
But how can I look for these in a string to replace them best?
If a string looks something like this:
$headline=“This is "my" best, and it's great”;
I want it to deliver the following before inserting:
This is “my” best, and it’s great
Is there a simple way to replace ascii code to UTF-8 or do I have to check for the different ascii codes and replace them one by one?
Any solutions?