I'm slowly attempting to convert some scripts from perl to php and running into some problems. Replace functions that have normally worked for me have suddenly stopped.
str_replace(".","",$MainSentence);
str_replace("!","",$MainSentence);
str_replace("\?","",$MainSentence);
str_replace(",","",$MainSentence);
str_replace(";","",$MainSentence);
str_replace("\"","",$MainSentence);
str_replace("_"," ",$MainSentence);
str_replace(" "," ",$MainSentence);
strtolower($MainSentence);
preg_replace($SmallWords," ",$MainSentence);
is done in a foreach loop. $SmallWords is an array containing '/text/' fields. The str_replaces and lower don't function at all, and the preg_replace produces the error:
Warning: No ending delimiter '/' found in /Library/WebServer/Documents/txtparse.php on line 152
Warning: Delimiter must not be alphanumeric or backslash in /Library/WebServer/Documents/txtparse.php on line 152
each time the loop goes around. Can anyone help? Thanks