Is this a database problem, or are quotes simply not allowed for the type of information you're collecting? (Since you say "meta description," I'll assume this is for an HTML meta tag, where quotes would mess up the HTML output.)
Use str_replace
:
PHP Code:
<?php
$quotes = 'I just wanted to say "Hello!"';
# three arguments:
# 1) the string to search for, in this case, " (double-quotes)
# 2) the string to replace with, in this case, nothing (an empty string)
# 3) the subject string
$noQuotes = str_replace( '"','',$quotes );
print $noQuotes;
/* prints
I just wanted to say Hello!
*/
If this is indeed for a meta tag, you'd probably want to strip out single-quotes as well:
PHP Code:
str_replace( array( "'","'" ),'',$quotes );
# note, that's "'" (a single quote, in a double-quoted string) and '"' (a double-quote, in a single-quoted string).
Bookmarks