Dville Posted July 26, 2006 Share Posted July 26, 2006 I am looking to take a string stored in $variable, and search it for the & character, and replace it with '&' without the ' ' before placing into the database.I find this character breaks the xml feed, and I'd rather not have to edit the database each and every time.Thanks in advanced to anyone that can help with this trick. Link to comment Share on other sites More sharing options...
Dville Posted July 26, 2006 Author Share Posted July 26, 2006 // This code will remove the '&' chracters to prevent it from breaking the rss feeds$oldWord = "&";// The new word we want in place of the old one$newWord = "&";// Run through the text and replaces all occurrences of $oldText$ArticleBody = str_replace($oldWord , $newWord , $ArticleBody);figured it out, rock on Link to comment Share on other sites More sharing options...
ryanlwh Posted July 26, 2006 Share Posted July 26, 2006 htmlentities() Link to comment Share on other sites More sharing options...
Recommended Posts