mysql_escape_string(strip_tags($arr[“$val”]));
- /**
- * 函数名称:post_check()
- * 函数作用:对提交的编辑内容进行处理
- * 参 数:$post: 要提交的内容
- * 返 回 值:$post: 返回过滤后的内容
- */
- function post_check($post){
- if(!get_magic_quotes_gpc()){// 判断magic_quotes_gpc是否为打开
- $post = addslashes($post);// 进行magic_quotes_gpc没有打开的情况对提交数据的过滤
- }
- $post = str_replace(“_”,“\_”,$post);// 把 ‘_’过滤掉
- $post = str_replace(“%”,“\%”,$post);// 把 ‘%’过滤掉
- $post = nl2br($post);// 回车转换
- $post =htmlspecialchars($post);// html标记转换
- return $post;
- }