You can find the small library at Github.
The library requires PHP 7.
The recommended installtion is via Composer.
composer require gordonlesti/longest-common-subsequence
Calculate the length of the longest common subsequence of two strings.
$lcsDist = LongestCommonSubsequence::lcs("DABDC", "CBDBBAC");
The library supports UTF-8.
$lcsDist = LongestCommonSubsequence::lcs("ΛΕΡΒΗΔΟΗΜΑΕΞΞΘΒΗ", "ΗΝΞΛΒΑΚΛ");