I'm having difficulties escaping double quotes using the PHP addslashes function. If I run:
$name = addslashes(get_the_title());
And the title has double quotes in it, the output still has double quotes without any escape characters.
eg. “Welcoming Diversity” Immigration Forum
I'm trying to insert Wordpress data into an .ICS file generator, but I'm unable to find a way to successfully parse the Wordpress data into a format that co-operates with the ICS format.
SOLUTION: My solution was to bypass the Wordpress function get_the_title() by using $post->post_title instead. Escaping worked properly with addslashes once I switched.
Maybe trim helps (for scaping regular quotes):
For other kind of quotes you could try using regular expressions. Something like: