i have the following code
$title = trim($tit);
$title = strtolower($tit);
$title = preg_replace("/\s/m", "_", $title);
$title = preg_replace("/\'/m", "_", $title);
$title = preg_replace("/[0-9+~!?@#;$%^&’*()\s]/", "", $title);
The problem arises when i have the following title
People are great - like or dislike?
And that converts to
people_are_great_�_like_or_dislike
I've tried many options like adding the dash in the final preg_replace in the code above. I tried to have a separate str_replace before the trim, after the preg_replaces etc. It doesn't seem to work.