当我运行,通过该功能,它与QUOT更换引号包含双引号短语删除单引号和双引号。如何从一个字符串
我要彻底删除它们(也单引号)。我如何改变功能来做到这一点?
function string_sanitize($s) {
$result = preg_replace("/[^a-zA-Z0-9]+/", "", $s);
return $result;
}
更新:
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
此功能已经削减了两个'''和'“' – zerkms 2011-03-28 03:14:53