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             ->filter(fn ($page) => str_starts_with(

                Str::slug($page['title'], ' '),

                Str::slug($search, ' ')

            ))->keys()->first() ?? $this->pages()->map(fn ($page) => similar_text(

                Str::slug($page['title'], ' '),

                Str::slug($search, ' '),

            ))

            ->filter(fn ($score) => $score >= min(3, Str::length($search)))

            ->sortDesc()

            ->keys()
<?php             ->filter(fn ($section) => str_starts_with(

                Str::slug($section['title'], ' '),

                Str::slug($this->argument('section'), ' ')

            ))->keys()->first() ?? $this->sectionsFor($page)->map(fn ($section) => similar_text(

                Str::slug($section['title'], ' '),

                Str::slug($this->argument('section'), ' '),

            ))

            ->filter(fn ($score) => $score >= min(3, Str::length($this->argument('section'))))

            ->sortDesc()

            ->keys()