|
|
|
|
![]() ![]() |
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. |
|
|
|
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 |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 7th October 2008 - 03:26 PM |