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 8061781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:27:14+00:00 2026-06-05T10:27:14+00:00

My PHP script needs to check for matches throughout an array of data. It’s

  • 0

My PHP script needs to check for matches throughout an array of data. It’s currently looking for exact string matches. I’d like it to be less strict.

For example, if the array holds the string “Tom and Jerry” I would like to return true for: “Tom Jerry”, “Tom & Jerry” and maybe even “Tom and Jery”. I found links to PHP search engines they are more complex and not really what I need. My data is fairly small and dynamic, so there’s no indexing.

I know I could write a big hairy regular expression, but I’m pretty sure I would be reinventing the wheel, because I’m sure others have already done this. Any advice on where to look or how to approach this would be much appreciated.

EDIT: To clarify, I’m trying to avoid entering all the dynamically generated data into a DB.

  • 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-06-05T10:27:16+00:00Added an answer on June 5, 2026 at 10:27 am

    I just discovered two functions which appear to do what I want:

    similar_text()

    levenshtein()

    Both seem to return an intiger representing the "closeness" of the match between two strings. The difference between the two is over my head.

    My search was aided by this S.O. question.

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

Sidebar

Related Questions

I need a PHP script to decrypt the RSA encrypted string generated by this
Need your help with my PHP/MYSQL array. I have a php script that selects
I'm currently writing a little commercial PHP Script which would be a VPN (PPTP)
I am writing a script that needs to send an e-mail through the PHP
I'm having some problems with the php script below that I'm currently working on.
I am looking for a way to use a PHP script to control access
I have a php script I need to run every 5 seconds (run, wait
i have a php script where i need to create a zip archive with
I have a PHP script with infinite loop. I need this script running forever.
I'm using the David Walsh PHP calendar script and need to format my date

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.