trait SuggestionTrait

Suggestion trait.

Methods

string|null
suggest(string $string, array $alternatives)

Returns the string that resembles the provided string the most.

Details

at line 25
protected string|null suggest(string $string, array $alternatives)

Returns the string that resembles the provided string the most.

NULL is returned if no string with a similarity of 66% or more is found.

Parameters

string $string String
array $alternatives Alternatives

Return Value

string|null