similar_text

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Calculate the similarity between two strings
<?php similar_text(string $string1, string $string2, float &$percent = null): int
<?php     {

        return $this->getAvailableMethods($class)

            ->sortByDesc(function (ReflectionMethod $method) use ($invalidMethodName) {

                similar_text($invalidMethodName, $method->name, $percentage);



                return $percentage;

            })->first();
<?php     {

        return $this->getAvailableProperties($class)

            ->sortByDesc(function (ReflectionProperty $property) use ($invalidPropertyName) {

                similar_text($invalidPropertyName, $property->name, $percentage);



                return $percentage;

            })
<?php                 return $percentage;

            })

            ->filter(function (ReflectionProperty $property) use ($invalidPropertyName) {

                similar_text($invalidPropertyName, $property->name, $percentage);



                return $percentage >= self::MINIMUM_SIMILARITY;

            })->first();
<?php         string $viewFile

    ): array {

        return collect($throwable->getViewData())->map(function ($value, $key) use ($variableName) {

            similar_text($variableName, $key, $percentage);



            return ['match' => $percentage, 'value' => $value];

        })->sortByDesc('match')->filter(function ($var, $key) {
<?php         return Collection::make($strings)

            ->sortByDesc(function (string $string) use ($input) {

                similar_text($input, $string, $percentage);



                return $percentage;

            })