There is an algorithm called longest common sub sequence. If you can find the longest common sub sequence of the strings of database for the given string and sort it, you'll get the most matched word. But I think this algo is developed already and available in your context. It's name can be different. As a developer I am not sure actually what function in php or mysql serves the purpose. Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php