Re: Fast prefix search?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/14/07, Nathan Nobbe <quickshiftin@xxxxxxxxx> wrote:
> can you use the php string manipulation functions ?

I'll probably use strstr() to check whether a string starts with some prefix.
But problem I like to solve is how to effectively pick strings
starting with a prefix
from a large dataset, like a dictionary.

If Berkeley DB's set_range were available from PHP,
I could write something like

$word = dba_set_range($prefix, $dictionary) // get  the  first word
starting with $prefix
do {
  if (!prefix($word) == $prefix) break
  $found[] = $word
} while ($word = dba)_nextkey($dictionary))

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux