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;

<?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

dinamic "textboxes"?
Ey all, my first post here, i hope its not a hard one

I display mysql results in a table

Help with some dates
I have a list of dates in an array:

$mondays = array(
strtotime("October 12, 2009

some questions
Hello,

I am looking for the answers for following questions:

1) Does PHP support overl

Strip Slashes Help
I've got a script that i've downloaded of the net to edit multiple fields from my sql database, and

what business processes?
Hi,

A general question. What business processes (like OTC - Order to Cach, P2P, R2R etc)

file downloaded can't be read !!
<?php
$fileName = 'mypic.jpg';
$mimeType = 'image/jpeg';
header('content-dispositio

Check premium expire
Hi,

I am making a simple file hosting site and want to check if users premium subscriptions h

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

Need help with a mail notify function
I was tasked with setting up a site that's been prewritten. The site is basically a form that captur

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

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