I was inserting some data on the fields of my website then i copy and pasted a string from another text editor(MS Word), then on my console log it recognizes the long single hyphen ( – ) which is the same as at PHP. But then when i execute the query the value from the database becomes different which is this:
`–`
This is the filtering that i do but as i said php recognizes it as a long hyphen ( – ) and that's the reason why they can't catch it. My question is why? Or any solution on the DB?
$_raw_data = $_POST['edit_data'];
$_raw_data = preg_replace('/[^A-Za-z0-9\- \'"{},:;[]]/', '', json_encode($_raw_data));
$_raw_data = str_replace("'", "''", $_raw_data);
$_raw_data = json_decode($_raw_data, true);