When I run a phrase that contains double quotes through this function, its replacing the quotes with quot.
I want to completely remove them (also single quotes). How can I alter the function to do that?
function string_sanitize($s) {
$result = preg_replace("/[^a-zA-Z0-9]+/", "", $s);
return $result;
}
Update:
Example 1: This is 'the' first example
returns: Thisis030the039firstexample
Errors: Warning: preg_match_all() [function.preg-match-all]: Unknown modifier '0' in C
Example 2: This is my "second" example
returns: Thisismyquotsecondquotexample
Errors: Invalid express in Xpath
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…