PHP code example of codedruids / simple-diff

1. Go to this page and download the library: Download codedruids/simple-diff library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codedruids / simple-diff example snippets


$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);