I think my PHP parser is not formatting my text right. I get question marks anywhere there should be a single quote in my text. You can see it on my Clevelandbloogers.com site. Does anyone know how to get rid/prevent of these? I thought about throwing the text through the htmlentities() script but the problem, i only want to replace the single quotes, not all the other stuff that htmlentities() changes to html text. Any ideas?
Your site appears to be down right now My guess is you wrote your text in a program like Word and copy/pasted that into your website. Programs like Word automatically will turn plain (straight) quotes into curly quotes, which PHP doesn't recognize. If possible, convert all your text to ASCII before entering it into your site OR add code to your script to automatically handle non-ASCII characters.
I agree with sketch, about it sounding like MS word chars in your string. The most common problem makers are dashes - vs —, quotes " vs “†and apostrophes ' vs ‘.
Huh... the site is fine for me now. It better not have gone down...stupid godaddy The problem is that i am using a feed aggregater to pull feeds into my site. These blogs' posts are whats being converted into the ?'s Is there a php script that can get rid of these?
Although I can't really see exactly whats wrong, str_replace("?", "'", $text); Code (markup): would replace all question marks with apostrophes in $text (generally the content of the article/whatever it is. Although im not too great with feeds etc, wouldn't know how to apply it edit: the reason your site is 'down' is because the url is wrong
If it's from a feed you don't have control over, then you'll definitely have to look into a script to convert those characters. Unfortunately deceti0n's script isn't good enough as it will replace actual question marks at the end of a question with the single apostrophe. When PHP doesn't recognize a special character, it's not actually putting out a ?, it's putting out some bizarre character that your browser or system doesn't recognize. So it's actually a combination of PHP and your system outputting those ?s.
ooohh that makes sense. Thanks Sketch. I will just have to keep track of which sites are doing it - and then find out which characters are causing the problem ?'s.