September 13th, 2000, 11:09 PM
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, 05: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, 08: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, 10: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 14th, 2000, 11:54 PM
ah cool thanks, so now i just have to figure out regular expressions =)