I have to split each word and compare it with in-built local dictionary and replace it with the equivalent word in another language.When I split a words with special characters (*eg:*of!) it will not match with dictionary even if they are the same.
Now I need to replace those special characters by empty strings.
$opis="of!";
$a=preg_replace('!"#$%&/()=?*+'-.,;:_', '', $opis);
print_r($a);
You can use
str_replaceorpreg_replaceExample
preg_replacehttp://php.net/manual/en/function.preg-replace.phpExample
str_replacehttp://php.net/manual/en/function.str-replace.phpOutput