Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6219055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:42:48+00:00 2026-05-24T07:42:48+00:00

after i searched i found how to do a fuzzy searching on a string

  • 0

after i searched i found how to do a fuzzy searching on a string

but i have an array of strings

$search = {"a" => "laptop","b" => "screen" ....}

that i retrieved from the DB MySQL

IS there any php class or function that does fuzzy searching on an array of words

or at least a link with maybe some useful info’s

i saw a comment that recommend using PostgreSQL

and it’s fuzzy searching capability but

the company had already a MySQL DB

Is there any recommendation ??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:42:49+00:00Added an answer on May 24, 2026 at 7:42 am

    Look at the Levenshtein function

    Basically it gives you the difference (in terms of cost) between to strings. I.e. what is the cost to transform string A into string B.

    Set yourself a threshold levenshein distance and anything under that for two words mean they’re similar.

    Also the Bitap algorithm is faster since it can be implemented via bitwise operators, but I believe you will have to implement it yourself, unless there is a PHP lib for it somewhere.

    EDIT
    To use levenshtein method:

    The search string is “maptop”, and you set your “cost threshold” to say 2. That means you want any words that are two string transform operations away from your search string.

    so you loop through your array “A” of strings until

    levenshtein ( A[i] , searchString ) <= 2

    That will be your match. However you may get more than one word that matches, so it is up to you how you want to handle the extra results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After lots of attempts and search I have never found a satisfactory way to
I'm new to jQuery. I've searched and found some results that might work, but
I have searched quite extensively throught stackoverflow but unfortunately found no conclusive answer to
After searched in google, found that jackson has better performance than gson, i plan
I have what I know is a simple question, but after many searches in
After correcting some other bugs on the application I found out that one page
I've searched and read and still haven't found a concrete answer. Brief: I have
I have searched all over for somebody else with this issue and found nothing...so
I've searched around a bit, but haven't found a satisfactory answer, so I'd like
I searched the web but haven't found a real good answer for this question..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.