Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Sos...sos...help Me Pls., Help to filter bad words
Rating 5 V
Azeri_boy
post Jun 5 2007, 06:58 PM
Post #1


Newbie [Level 1]
*

Group: Members
Posts: 23
Joined: 10-April 07
From: Azerbaijan
Member No.: 41,391



I should filter bad words and replace them with three dot. I know this is not so difficult to write function for such purpose. But function that I wrote doesn't give any result neither necessary result nor error. May be you know what's going wrong with my function.
Code:
CODE

<?php
$abuse_list=array("abuse","bad");
function filter_bad_words($s)
{
global $abuse_list;
foreach($abuse_list as $k=>$v)
{
eregi_replace("^".$v."$","...",$s);
}
return $s;
}
$s="abuse, badness, bad word";
echo filter_bad_words($s);
?>

Thanks beforehand.

The problem was in the way of using function eregi_replace() must be so:
$s=eregi_replace($v,"...",$s). RegEx patern also was incorrect. I had hurryed.
In general filter bad words is not good idea. smile.gif
Go to the top of the page
 
+Quote Post
zak92
post Jun 8 2007, 09:41 PM
Post #2


Super Member
*********

Group: Members
Posts: 225
Joined: 5-January 07
Member No.: 36,560



Please do not double post as this is considered spamming. Please use the edit feature thank you.

maybe this will help you. Also please use the search function.
http://www.trap17.com/forums/offensive-lan...ter-t22090.html

This post has been edited by zak92: Jun 8 2007, 09:41 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Offensive Language Filter(4)


 



- Lo-Fi Version Time is now: 7th October 2008 - 03:26 PM