similar_text

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Calculate the similarity between two strings
similar_text(string $string1string $string2float &$percent null): int
    {

        return 
$this->getAvailableMethods($class)

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

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



                return 
$percentage;

            })->
first();
    {

        return 
$this->getAvailableProperties($class)

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

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



                return 
$percentage;

            })
                return $percentage;

            })

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

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



                return 
$percentage >= self::MINIMUM_SIMILARITY;

            })->
first();
        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) {
        return Collection::make($strings)

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

                
similar_text($input$string$percentage);



                return 
$percentage;

            })
    {

        return 
$this->getAvailableMethods($class)

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

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



                return 
$percentage;

            })->
first();
    {

        return 
$this->getAvailableProperties($class)

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

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



                return 
$percentage;

            })
                return $percentage;

            })

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

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



                return 
$percentage >= self::MINIMUM_SIMILARITY;

            })->
first();