Instantly share code, notes, and snippets.

Embed
What would you like to do?
multiple string replacements with php str_replace
//loops through each array by key, so $quotes[0] replaces $replace[0]
$quotes = ["\\'",'\\"'];
$replace = ["'",'"'];
$newsletter_article_html = str_replace($quotes, $replace, $newsletter_article_html);
return $newsletter_article_html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment