[PHP] link counting

2007-04-06 Thread Sebe
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

Re: [PHP] link counting

2007-04-06 Thread Tijnema !
On 4/6/07, Sebe [EMAIL PROTECTED] 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.');

RE: [PHP] link counting

2007-04-06 Thread Jay Blanchard
[snip] 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

Re: [PHP] link counting

2007-04-06 Thread Paul Novitski
At 4/6/2007 06:01 AM, Sebe wrote: i thought of an idea of counting the number of links to reduce comment spam. I do this by counting the number of 'http://' instances in the text. You can use a variety of PHP functions: - substr_count() - preg_match_all() then count() the result array -