Skip to content
/ text-diff Public

A simple text differences visualization method for PHP

Notifications You must be signed in to change notification settings

qazd/text-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextDiff for PHP

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

DiffText Example

Installation

  • via Composer composer require qazd/text-diff
  • via Git git clone https://github.com/qazd/text-diff.git
  • or download zip

Usage

<?php
  require 'vendor/autoload.php';

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

<html>
<head>
	<title>TextDiff</title>
	<link rel="stylesheet" type="text/css" href="vendor/qazd/text-diff/css/style.css">
</head>
<body>

	<?= $table ?>

</body>
</html>

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.

More

About

A simple text differences visualization method for PHP

Resources

Stars

Watchers

Forks

Packages

No packages published