php-extended/polyfill-str-longest-common-substring

A php implementation of the longest common substring algorithm

1.4.6 2024-07-31 13:28 UTC

README

A php implementation of the longest common substring algorithm.

coverage build status

Installation

The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.

  • Download composer.phar from their website.
  • Then run the following command to install this library as dependency :
  • php composer.phar php-extended/polyfill-str-longest-common-substring": "^1"

Basic Usage

This library gives the function strLongestCommonSubstring(?string $str1, ?string $str2) : string :


$lcs = \strLongestCommonSubstring('foobarbaz', 'quxfoobar');
// $lcs is 'foobar'

License

MIT (See license file).