PHPackages                             lbbniu/diff-match-patch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lbbniu/diff-match-patch

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lbbniu/diff-match-patch
=======================

Port of the google-diff-match-patch (https://code.google.com/p/google-diff-match-patch/) lib to PHP

v1.0.3(7y ago)014Apache-2.0PHPPHP &gt;=5.3

Since Nov 24Pushed 7y agoCompare

[ Source](https://github.com/lbbniu/diff-match-patch)[ Packagist](https://packagist.org/packages/lbbniu/diff-match-patch)[ Docs](https://code.google.com/p/google-diff-match-patch/)[ RSS](/packages/lbbniu-diff-match-patch/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Diff-Match-Patch
================

[](#diff-match-patch)

[![Build Status](https://camo.githubusercontent.com/ed3b5c616354ff64d4202a2d3411dddcc7f1cbddcb98a288db112ddf26d2d53b/68747470733a2f2f7472617669732d63692e6f72672f796574616e6f746865726170652f646966662d6d617463682d70617463682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yetanotherape/diff-match-patch)[![Latest Stable Version](https://camo.githubusercontent.com/cd45db8b4c39b8c7442755a0e1699e86a2be5de0d1379a748afa3f39780e719a/68747470733a2f2f706f7365722e707567782e6f72672f796574616e6f746865726170652f646966662d6d617463682d70617463682f762f737461626c65)](https://packagist.org/packages/yetanotherape/diff-match-patch)[![Total Downloads](https://camo.githubusercontent.com/f48c5a47379d56837527da7c81bcbb1263c7cd83ba7e9ffa1fd70a463bbb73fc/68747470733a2f2f706f7365722e707567782e6f72672f796574616e6f746865726170652f646966662d6d617463682d70617463682f646f776e6c6f616473)](https://packagist.org/packages/yetanotherape/diff-match-patch)

The Diff Match and Patch libraries offer robust algorithms to perform the operations required for synchronizing plain text:

- computes character-based diff of two texts
- performs fuzzy match of given string
- applies a list of patches.

This is the port of Google's [diff-match-patch](https://github.com/google/diff-match-patch) library to PHP.

Diff
----

[](#diff)

Compare two plain text and efficiently return a array of differences. It works with characters, but if you want to compute word-based or line-based diff — you can easily [tune](https://web.archive.org/web/20160110201643/https://code.google.com/p/google-diff-match-patch/wiki/LineOrWordDiffs)it for your needs.

Usage:

```
