Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- nonstandard symbols: function to replace?
November 12, 2005, 9:54 pm
rate this thread
Some of my writers are submitting stuff they've typed into Word (ughh),
meaning we get annoying symbols instead of " and '. I know I can build
a search and replace into my submissions form to stop these at the
source, but I don't want to run this through the existing 500 articles.
Is there some kind of method or function to display these? My
database-pulled content just displays a ? for them at the moment.
Re: nonstandard symbols: function to replace?
Please quote the post you're replying to so that people know what you're
No need to do it manually! Say you have a function "fixsymbols()" that can
fix the symbols, simply create a script like this:
$r = mysql_query("SELECT articleid, content FROM articles;");
while ($a = mysql_fetch_array($r))
$id = $a;
$content = addslashes(fixsymbols($a));
$q = "UPDATE articles SET content='$content' WHERE articleid='$id';";
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact