Re: [PHP] String searching peformance

2003-02-26 Thread {R}ichard Ashton
On Mon, 24 Feb 2003 22:35:35 +0100, Ernest E Vogelsinger wrote: At 21:22 24.02.2003, {R}ichard Ashton spoke out and said: [snip] while ( $flag == true ) if (strpos($body, $word[]) 0) {$flag=false} What I really need to know is which is the fastest loop?

Re: [PHP] String searching peformance

2003-02-26 Thread Ernest E Vogelsinger
At 09:49 26.02.2003, {R}ichard Ashton said: [snip] Do you think that: if (preg_match($re, $posting, $hits)) would slow it down at all. The $buzzwords will be kept in a file to be loaded before each run, every 5 minutes. I could therefore keep a count of

Re: [PHP] String searching peformance

2003-02-26 Thread Jason Wong
On Wednesday 26 February 2003 16:49, {R}ichard Ashton wrote: Do you think that: if (preg_match($re, $posting, $hits)) would slow it down at all. The $buzzwords will be kept in a file to be loaded before each run, every 5 minutes. I could therefore keep a count of which words hit most

Re: [PHP] String searching peformance

2003-02-26 Thread {R}ichard Ashton
On Wed, 26 Feb 2003 17:47:41 +0800, Jason Wong wrote: On Wednesday 26 February 2003 16:49, {R}ichard Ashton wrote: Do you think that: if (preg_match($re, $posting, $hits)) would slow it down at all. The $buzzwords will be kept in a file to be loaded before each run, every 5 minutes. I could

[PHP] String searching peformance

2003-02-24 Thread {R}ichard Ashton
I am looking for the most efficient way to search for Trigger words in a big string. I have a string, $body which is all of the body of any particular Usenet Post, so it can be as short as Me too and up to some, as yet undecided, limit say around 10Kbytes. I have a list of words in an array,

Re: [PHP] String searching peformance

2003-02-24 Thread Ernest E Vogelsinger
At 21:22 24.02.2003, {R}ichard Ashton spoke out and said: [snip] while ( $flag == true ) if (strpos($body, $word[]) 0) {$flag=false} What I really need to know is which is the fastest loop? Which is the fastest match, strpos? Which is the fastest