This one time, at band camp, Mag <[EMAIL PROTECTED]> wrote:

> Hi,
> I am useing file_get_contents on a remote page then
> using stristr() to make sure there are no "bad words"
> and its a family site.
> Right now I am checking for just 3 bad words which
> means 3 stristr() function calls, but if the bad words
> increase then that would mean more calls....

  $badwords = array('poo', 'bum', 'perl');

  $goodString = str_replace($badwords, '***', file_get_contents($url);

  echo $goodString;

If you are using php5 you can use str_ireplace() for a case insensitive 
search

Kevin
---------
"Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to