php-extended / polyfill-str-longest-common-substring
A php implementation of the longest common substring algorithm
1.1.0
2022-05-31 07:34 UTC
Requires
- php: >=7.2
Requires (Dev)
README
A php implementation of the longest common substring algorithm.
Installation
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/polyfill-str-longest-common-substring": "^1",
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
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).