PHPackages                             rap2hpoutre/similar-text-finder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. rap2hpoutre/similar-text-finder

ActiveLibrary[Search &amp; Filtering](/categories/search)

rap2hpoutre/similar-text-finder
===============================

Fuzzy Search, similar text finder: "Did you mean `foo` ?"

1.1.0(7y ago)13877.7k↑467.6%173MITPHPPHP ^7.0

Since Apr 21Pushed 2y ago10 watchersCompare

[ Source](https://github.com/rap2hpoutre/similar-text-finder)[ Packagist](https://packagist.org/packages/rap2hpoutre/similar-text-finder)[ RSS](/packages/rap2hpoutre-similar-text-finder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (10)Used By (3)

Similar Text Finder
===================

[](#similar-text-finder)

[![Packagist](https://camo.githubusercontent.com/48f48a534019e331a8a57e2c957ba6e351f1f1a8d2b5eab3e80144c13f992e36/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7261703268706f757472652f73696d696c61722d746578742d66696e6465722e737667)](https://packagist.org/packages/rap2hpoutre/similar-text-finder)[![Code Coverage](https://camo.githubusercontent.com/0fbcd3a6fea8fcd9fd25cb4af0e4957646dcbfdf921828d2d1bd5a24ce787b64/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7261703268706f757472652f73696d696c61722d746578742d66696e6465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rap2hpoutre/similar-text-finder/?branch=master)[![Packagist](https://camo.githubusercontent.com/0c83c80ac26458bb59ff62bca4b7b6ba9dbe0e10b8f6e8b748de7c9cb9fadd43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7261703268706f757472652f73696d696c61722d746578742d66696e6465722e737667)](https://packagist.org/packages/rap2hpoutre/similar-text-finder)

TL;DR
-----

[](#tldr)

Similar text finder. Install via composer, works with any framework: Laravel, Slim, Symfony, etc.

[![screenshot](https://cloud.githubusercontent.com/assets/1575946/7246876/1b15c4c0-e803-11e4-91d8-a2e7cd5a0f0c.png)](https://cloud.githubusercontent.com/assets/1575946/7246876/1b15c4c0-e803-11e4-91d8-a2e7cd5a0f0c.png)

```
// Init Similar Text Finder with a needle and a haystack
$text_finder = new \SimilarText\Finder('bananna', ['apple', 'banana', 'kiwi']);

// Get first similar word (it's banana)
echo $text_finder->first();
```

Installation
------------

[](#installation)

Install with composer `composer require rap2hpoutre/similar-text-finder`. That's all.

You can now use it in your framework's controller, or wherever you want (you don't need a framework anyway).

Usage
-----

[](#usage)

### Quick start

[](#quick-start)

Just build a new Similar Text Finder like this:

```
$tf = new \SimilarText\Finder($needle, $haystack);
```

`$needle` may be the user input and `$haystack` should be an array with all your suggestion. You can display the closest response like this:

```
echo 'Did you mean ' $tf->first() . ' ?';
```

Or use it in your favorite template engine (Twig, Blade, etc.)

You can get all your suggestion ordered by most approching words like this:

```
$all = $tf->all();
```

### Example in raw PHP

[](#example-in-raw-php)

```
use SimilarText\Finder;

// User input with a typo (you could get it from $_GET)
$needle = 'tmatoes';

// Your list (from your database or an API)
$haystack = ['salad', 'tomatoes', 'onions', 'mates'];

// Init Text Finder
$finder = new Finder($needle, $haystack);

// Display all results ordered by the most approching
$results = $finder->all();
echo implode(', ', $results);

// You should see something like "tomatoes, mates, onions, salad", yohoo.
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 90% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~200 days

Recently: every ~345 days

Total

8

Last Release

2640d ago

Major Versions

v0.3.0 → v1.0.02019-01-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/849c3b70e82874c89e079738e4879e0eabb71d1a73f53e81b88c39a9b40f32ae?d=identicon)[rap2hpoutre](/maintainers/rap2hpoutre)

---

Top Contributors

[![rap2hpoutre](https://avatars.githubusercontent.com/u/1575946?v=4)](https://github.com/rap2hpoutre "rap2hpoutre (45 commits)")[![josegonzalez](https://avatars.githubusercontent.com/u/65675?v=4)](https://github.com/josegonzalez "josegonzalez (2 commits)")[![joskolenberg](https://avatars.githubusercontent.com/u/26161164?v=4)](https://github.com/joskolenberg "joskolenberg (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

composerfuzzy-searchhacktoberfestphpsearchtext-findersearchlaraveltextsimilar textfindlevenshteinfuzzy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rap2hpoutre-similar-text-finder/health.svg)

```
[![Health](https://phpackages.com/badges/rap2hpoutre-similar-text-finder/health.svg)](https://phpackages.com/packages/rap2hpoutre-similar-text-finder)
```

###  Alternatives

[mmanos/laravel-search

A search package for Laravel 5.

36475.7k1](/packages/mmanos-laravel-search)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
