How can I replace ' with \' ? I tried these but with no luck:
str_replace(''', '\'', $artist); str_replace('\'', '\\'', $artist);
Anyone got a way that works?
Thanks.
Try
$artist = str_replace("'", "\'", $artist);
Or take a look at addcslashes().
Or take a look at [man]mysql_real_escape_string[/man] if you're preparing data for a MySQL query.
Installer wrote:Try$artist = str_replace("'", "\'", $artist);Or take a look at addcslashes().
That worked like a charm, thank you!
Cheers for the other options aswell.