Re: link counting
| From: | Tijnema ! | Date: | Fri, 06 Apr 2007 13:10:45 +0000 |
| Subject: | Re: link counting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-252150@lists.php.net to get a copy of this message | ||
On 4/6/07, Sebe <sebastian@dslr.net> wrote:
i thought of an idea of counting the number of links to reduce comment spam. unfortunately my methods is not reliable, i haven't tested it yet though.. anyone have maybe a better solution using some regexp? $links = array('http://', 'https://', 'www.'); $total_links = 0; foreach($links as $link) {I don't have a better way, but links starting with http://www. or https://www. are counted twice in your script... Tijnema$total_links = substr_count($string, $link);} if($total_links > X) { ..... }
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php