PHPackages                             v-bartusevicius/levenshtein-array-sort - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. v-bartusevicius/levenshtein-array-sort

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

v-bartusevicius/levenshtein-array-sort
======================================

Sorts haystack with strings by Levenshtein distance to needle

0171PHP

Since Mar 7Pushed 11y ago1 watchersCompare

[ Source](https://github.com/v-bartusevicius/levenshtein-array-sort)[ Packagist](https://packagist.org/packages/v-bartusevicius/levenshtein-array-sort)[ RSS](/packages/v-bartusevicius-levenshtein-array-sort/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

levenshtein-array-sort
======================

[](#levenshtein-array-sort)

Sorts given array of strings by Levenshtein distance.

Simply use:

```
$needle = 'text';
$haystack = array('texas', 'test', 'random');

$sorter = new ArraySort();
$result = $sorter->sort($needle, $haystack);

print_r($result);
```

The result will be represented as ordered array with keys as Levenshtein distance to needle:

```
Array
(
    [1] => test
    [2] => texas
    [6] => random
)

```

In case there are same distances to needle, the nested array will be created:

```
$needle = 'text';
$haystack = array('texas', 'test', 'texts', 'random');

$result = $sorter->sort($needle, $haystack);

print_r($result);
```

```
Array
(
    [1] => Array
        (
            [0] => test
            [1] => texts
        )

    [2] => texas
    [6] => random
)

```

\#Installation: `composer require v-bartusevicius/levenshtein-array-sort`

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7456f9a0de498d31dc59bc486804997d409647df3e9d77d45aaa7c729316bd2?d=identicon)[v-bartusevicius](/maintainers/v-bartusevicius)

---

Top Contributors

[![vbartusevicius](https://avatars.githubusercontent.com/u/7325630?v=4)](https://github.com/vbartusevicius "vbartusevicius (4 commits)")

### Embed Badge

![Health badge](/badges/v-bartusevicius-levenshtein-array-sort/health.svg)

```
[![Health](https://phpackages.com/badges/v-bartusevicius-levenshtein-array-sort/health.svg)](https://phpackages.com/packages/v-bartusevicius-levenshtein-array-sort)
```

###  Alternatives

[smart-crowd/simple-sms-drivers

Addition providers for simple SMS laravel package

101.0k](/packages/smart-crowd-simple-sms-drivers)

PHPackages © 2026

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