PHP code example of riki137 / finediff

1. Go to this page and download the library: Download riki137/finediff 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/ */

    

riki137 / finediff example snippets


$diff = new FineDiff\Diff();
echo $diff->render('string one', 'string two');

$diff = new FineDiff\Diff(new FineDiff\Granularity\Word());
// Or via the setter method:
$diff->setGranularity(new FineDiff\Granularity\Word());

$diff = new FineDiff\Diff();
echo $diff->getOpcodes('string one', 'string two');

$renderer = new FineDiff\Render\Text();
echo $renderer->process('string one', 'c7d3i3:two');

$renderer = new FineDiff\Render\Html();
echo $renderer->process('string one', 'c7d3i3:two');