Skip to content
forked from ilya-dev/fuzzy

Nice PHP library for fuzzy string searching, also known as "approximate string matching".

License

Notifications You must be signed in to change notification settings

tarekadam/fuzzy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fuzzy

Fuzzy searching in PHP made easy!

Installation

composer require ilya/fuzzy:~1

Use

array search(array $rows, string $query, integer $threshold = 3)

$rows = ['f', 'fo', 'foo', 'foob', 'fooba', 'foobar'];

$fuzzy = new \Fuzzy\Fuzzy;

$query = 'foobar';

$fuzzy->search($rows, $query, 0); // ['foobar']
$fuzzy->search($rows, $query, 1); // ['foobar', 'fooba']
$fuzzy->search($rows, $query, 2); // ['foobar', 'fooba', 'foob']
$fuzzy->search($rows, $query, 3); // ['foobar', 'fooba', 'foob', 'foo']

License

This project is licensed under the MIT license.

About

Nice PHP library for fuzzy string searching, also known as "approximate string matching".

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%