Re: [PHP] Fast search

2006-05-18 Thread Richard Lynch
On Wed, May 17, 2006 11:37 am, René Fournier wrote: > Looking for suggestions on the most compute-efficient way to search > variable-length strings (~200 characters) for the occurrence of one > of about 100 possible needles. In other words: > > $needles = array ( 1 => "Hello Jim" , 2 => "Yellow Ban

Re: [PHP] Fast search

2006-05-17 Thread Robert Cummings
On Wed, 2006-05-17 at 16:38, Robin Vickery wrote: > On 17/05/06, René Fournier <[EMAIL PROTECTED]> wrote: > > Looking for suggestions on the most compute-efficient way to search > > variable-length strings (~200 characters) for the occurrence of one > > of about 100 possible needles. In other words

Re: [PHP] Fast search

2006-05-17 Thread Evan Priestley
You can make a pretty effective time/memory tradeoff -- particularly if your array of patterns is relatively fixed -- but unless you re- implement this in C, it will probably be slower than a brute force approach with the str* functions unless you are searching for a fairly huge number of ne

Re: [PHP] Fast search

2006-05-17 Thread Robin Vickery
On 17/05/06, René Fournier <[EMAIL PROTECTED]> wrote: Looking for suggestions on the most compute-efficient way to search variable-length strings (~200 characters) for the occurrence of one of about 100 possible needles. In other words: $needles = array ( 1 => "Hello Jim" , 2 => "Yellow Ban