<?php
$text = preg_split("/[\s,]+/", "Thanks for sharing, this article is great, here's http://www.spammer.com");
foreach($text as $w)
{
if( preg_match("/http\:|www\.|\.com/i",$w))
{
echo "Spam: $w\n";
}
}
?>
Perhaps, instead consider using regular expressions.
This splits the string into tokens and checks to see
if any token breaks the, no links policy, on the blog.