Skip to content
A simple text differences visualization library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
css fix comments Nov 28, 2016
examples examples Nov 28, 2016
src Replace deprecated each() with foreach() Nov 16, 2018

TextDiff for PHP

TextDiff is a simple library for text differences visualization. Based on Wordpress's Compare Revisions.

DiffText Example


  • via Composer composer require qazd/text-diff
  • via Git git clone
  • or download zip


  require 'vendor/autoload.php';

  $table = Qazd\TextDiff::render('String one', 'String two');

	<link rel="stylesheet" type="text/css" href="vendor/qazd/text-diff/css/style.css">

	<?= $table ?>


TextDiff::render() is the only available method. With the third argument set to false you can disable split view.

If you won't use Composer - just require src/TextDiff.php

Integrate css/style.css into your page to style the comparison table.


You can’t perform that action at this time.