Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- anyone know how wikipedia does string matches on all it's terms


jamie - 5:55 pm on Dec 1, 2011 (gmt 0)


well, i thought why not try it anyway... and it only takes microseconds to parse the 5000 names and preg_match:


foreach ($arr_names as $ID => $name)
{
if (preg_match('/(' . $name . ')\b/i', $_POST['str'], $matches))
{
$m[] = $matches[1];
}
}


(please don't try this with a wikipedia database of 10 million terms lol)


Thread source:: http://www.webmasterworld.com/php/4392861.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com