im making a page to monitor content typed into a kids website. the page just spits out all the new text that has been entered but not yet checked - the monitor can then flag inappropriate content.
i would like to highlight curse words to make it easier for the monitor to scan the text. im starting with a database table of naughty words (is that the best way to store the words?) and what i want is to check a string against all the naughty words.
example string:
results in:
so im wondering how i can check the string against EVERY word in the table, and i will need the position of each word found to insert the tags. this hurts my tiny mind, but someone cleverer than i might see this differently.
if i have to implement a solution that just highlights the whole block of text that contains a curse, that would be OK but not ideal.
any ideas appreciated!
i would like to highlight curse words to make it easier for the monitor to scan the text. im starting with a database table of naughty words (is that the best way to store the words?) and what i want is to check a string against all the naughty words.
example string:
Code:
"you are a mother-sucking poophole"
Code:
"you are a <strong>mother-sucking</strong><strong>poophole</strong>"
so im wondering how i can check the string against EVERY word in the table, and i will need the position of each word found to insert the tags. this hurts my tiny mind, but someone cleverer than i might see this differently.
if i have to implement a solution that just highlights the whole block of text that contains a curse, that would be OK but not ideal.
any ideas appreciated!