Skip to content

sebastiaanfranken/php-diff-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PHP Diff library

This is a PHP mini library to work with differences in two arrays. It's way of doing things is inspired by the way Git works, only simplified.

Using the library

Using the diff library isn't hard. You create a new instance of the class and you pass along your data arrays in the constructor and call one of the utility methods:

<?php
$diff = new Sfranken\Diff($a, $b);
print '<pre>' . print_r($diff->toArray(), true) . '</pre>';
?>

See the index.php file for a more in depth example of how to use this class

The toArray function shows the result as an array which you can work with later on.

Supported methods

The class has the following methods:

Demo image

Since an image is worth a thousand words.. php diff image

About

A basic PHP library for working with different datasets

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages