September 14th, 2000, 12:09 AM
I'm a newbie to php, I want to filter out certain words from my database. I was wondering how I would do this, and is there a way to store the list in a seperate file. ie. php making a call to a text file, if so how would i accomplish this?
thanks for the help,
September 14th, 2000, 06:07 AM
I was wondering how I would do this, and is there a way to store the list in a seperate file. ie. php making a call to a text file, if so how would i accomplish this?
Yea, definitly it can be done...
Either you can save that words in a file or in an array.then match with the table contents(probably you can loop through the contens and match with that words).
www.jobxyz.com-IT Career Portal
"The fear of the LORD is the beginning of knowledge..."
September 14th, 2000, 09:23 PM
how would i do this though? I'm relatively new to this, i know howto submit things into the database, but i'm clueless when it comes to filtering it out. I tried regular expressions once with no sucess.
September 14th, 2000, 11:31 PM
Hi DaV0, do you mean filter out swear words etc? - if so you could filter them before or after insertion with,
as Shiju suggests you could do this in a loop, & if you had your 'bad' words in a seperate textfile- 1 per line...
<? $baddies=file("badwords.txt");//$baddies is now an array of the lines in the textfile//
or something similar (I did not test that!)
September 15th, 2000, 12:54 AM
ah cool thanks, so now i just have to figure out regular expressions =)