I am trying to write an XML file as PHP. This is not valid however because of the smart quotes from the db. This is the ’ character. I've looked all over, but I can't find a single script that will find that character on my site and convert it to a character like '.
Any help on converting the smart quote would be greatly appreciated.
Thanks,
elHelgo
Converting Smart Quotes for PHP
Moderator: General Moderators
It comes out as the special one. It can be seen here:
http://si.unl.edu/yearoneunl/feed.xml
Don't think it's because it's xml, there is a switch in apache that will let it output as php. I'm running a bunch of php code inside, that is not the problem. The problem is still trying to remove those special characters.
-elHelgo
http://si.unl.edu/yearoneunl/feed.xml
Don't think it's because it's xml, there is a switch in apache that will let it output as php. I'm running a bunch of php code inside, that is not the problem. The problem is still trying to remove those special characters.
-elHelgo
mabey this will work
Code: Select all
<?php
$var = ereg_replace("’","'",$var);
?>or
Code: Select all
str_replace('’', "'", $content);
Last edited by Luke on Wed Oct 04, 2006 1:30 pm, edited 1 time in total.