Hello,
im trying to exclude some bad words that users may post in my blog. Now i know there must be several ways to achieve this (i dont want to use a db), but only 2 ways come in my mind:
1.Using eregi:
if(!eregi("badword1|badword2|badword3|", $post))
{ //ok}
- Using stristri and if statements:
---------------------------------------------------
if (stristr($post ,"bad1") ||
stristr($post ,"bad2") ||
stristr($post ,"bad3") )
{//bad words detected}
Which one do you think is faster? Any suggestions?
Thanks!