The character comes from an XML feed.
Here is an excerpt:
Kock’s parole
As you see, it is not a normal '
We tried
$sql = str_replace("’", "\'", $sql);
But that does nothing.
Any ideas?
The character comes from an XML feed.
Here is an excerpt:
Kock’s parole
As you see, it is not a normal '
We tried
$sql = str_replace("’", "\'", $sql);
But that does nothing.
Any ideas?
Try to replace
$sql = str_replace("’", "\'", $sql);
with
$sql = str_replace("’", "'", $sql);
I think if this is an sql statement, you will have to do something like this:
$sql = str_replace("’", "\\\'", $sql);
So for example if you sql statement is something like this:
$name = "Kock’s parole";
$name = str_replace("’", "\\\'", $name);
$sql = "INSERT INTO users (`name`) VALUES ('$name')";
then this will work fine for you.