Trouble Replacing Apostrophe with Preg_Replace
Have a go using str_replace()
, it's quicker than preg_replace()
since it doesn't use regular expressions.
$text = str_replace("'", '', $text);
you can use this regexp to remove apostrophes
$text = preg_replace('/(\'|�*39;)/', '', $text);
also you can use str_replace to remove apostrophes after doing html_entity_decode
$text = str_replace("'","", html_entity_decode($text, ENT_QUOTES));