proud Posted January 18, 2010 Share Posted January 18, 2010 I created a library management system using PHP.. Now, I want to create a search box in my system so that I can search for books by title, author.. What I want to do is to create a suggestions for my search box in case someone submitted a wrong value.. like for example if he entered anstein for the book author, it should provide him with something like: Did you mean einstein? It's similar to what you find in answers.com, wikipedia etc.. Any idea how I could do something like that? Quote Link to comment https://forums.phpfreaks.com/topic/188850-help-with-creating-suggestions-for-a-search-box/ Share on other sites More sharing options...
Buddski Posted January 18, 2010 Share Posted January 18, 2010 Have a read of this levenshtein() Its a very nifty function for doing just that.. And as for the array of words it will search against you can create that using specific words in your database Quote Link to comment https://forums.phpfreaks.com/topic/188850-help-with-creating-suggestions-for-a-search-box/#findComment-997001 Share on other sites More sharing options...
greatstar00 Posted January 18, 2010 Share Posted January 18, 2010 i remember there is a function, i forgot what it is this is the description it calculate the sound of two word like listen u may have lizten their sound are similar i remembered i read a function like this. Quote Link to comment https://forums.phpfreaks.com/topic/188850-help-with-creating-suggestions-for-a-search-box/#findComment-997041 Share on other sites More sharing options...
Buddski Posted January 18, 2010 Share Posted January 18, 2010 I think you are refering to soundex() There are a few other you can use like similar_text() Quote Link to comment https://forums.phpfreaks.com/topic/188850-help-with-creating-suggestions-for-a-search-box/#findComment-997043 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.