Word filter problem


Posted on 16th Feb 2014 07:03 pm by admin

Hello,

im trying to make a filter for words inputted in to my website but i want to store the swear word and the replacement for that word in a mysql db i have developed the code below;

Did you know?Explore Trending and Topic pages for more stories like this.
<?php

include("config.php");


$str = 'how are you have you got any money';




$result = mysql_query("SELECT * FROM table")
or die(mysql_error());

while($row = mysql_fetch_array( $result )) {
$words = array($row['word'],);
$filter = array($row['translated_word'],);


}
echo str_replace($words, $german, $str);
?>

but it just dose not return the filters how i need it to it will only list it as it returns them like

wordwordwordwordword

but i need it to return them like

word,word,word,word,word

how would i do this? please help me =] thanks
No comments posted yet

Your Answer:

Login to answer
209 Like 24 Dislike
Previous forums Next forums
Other forums

Reading Most Recent CSV File in Directory
I thought I had wrapped this project up, but found out that the program I use to FTP a csv file to m

Cron Job and Output
I have php codes running under a cron job.
But everytime i output (echo) , it comes out as comple

DOMDocument parsing
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This i

PL/SQL: ORA-00947: not enough values error message
Hi all i am getting Error(25,63): PL/SQL: ORA-00947: not enough values error message when executing

PO Release Strategy Issue
Hi Experts,

I am facing an issue related to PO release strategy. The details are-
<

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

Save data in input fields when they press "BACK BUTTON"
Hi, this is html form: And let's say they get a error "Please enter ur title must be more then

ClientScript.RegisterClientScriptBlock Issue
This is what I haveview plaincopy to clipboardprint?Protected Sub posrback_Click(ByVal sender As Obj

retrieving policy name inside the function called by this particular policy
Hi there,

I've playing around with dbms_rls package, trying to set up some security repo

order by date not ID number help php
I am trying to orginize the following code to order by date not id number.
any help would be grea

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash