douque9815
2011-06-02 17:21
浏览 157
已采纳

字符串清理,以支持ñ,á,é,í,ó,ú等特殊字符

I'm currently using this script to sanitize a block of text...

function rseo_sanitize($s) {
    $result = preg_replace("/[^a-zA-Z0-9'-]+/", "", html_entity_decode($s, ENT_QUOTES));
    return $result;
}

I'd like to add support for a collection of special characters such as ñ, á, é, í, ó, ú, etc

How can I integrate those (and the larger collection of spanish characters) into the preg_replace?

图片转代码服务由CSDN问答提供 功能建议

我目前正在使用此脚本来清理文本块... </ p>

  function rseo_sanitize($ s){
 $ result = preg_replace(“/ [^ a-zA-Z0-9' - ] + /”,“”,html_entity_decode($ s,ENT_QUOTES));  
返回$ result; 
} 
 </ code> </ pre> 
 
 

我想添加对特殊字符集合的支持,例如ñ,á,é,í,ó ,ú等</ p>

如何将这些(以及更大的西班牙语字符集合)集成到preg_replace中?</ p> </ div>

2条回答 默认 最新

相关推荐 更多相似问题