SimpleDiff is a PHP class wrapper for a simple diffing algorithm.
- PHP 5.4 or higher
Add the following to your composer.json
:
{
"require": {
"CodeDruids/simple-diff": "1.*"
}
}
$old = ['some','array','of','stuff'];
$new = ['some','array','of','other','stuff'];
$diff = \CodeDruids\SimpleDiff::diff($old, $new);
$oldHtml = "Some <b>HTML</b> you simply <i>cannot</i> ignore!";
$newHtml = "Some <b>HTML</b> you just <i>cannot</i> ignore!";
$htmlDiff = \CodeDruids\SimpleDiff::htmlDiff($oldHtml, $newHmtl);
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.