PHP code example of icap / html-diff

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

    

icap / html-diff example snippets


    set_

	use Icap\HtmlDiff\HtmlDiff;

	$htmlDiff = new HtmlDiff($oldText, $newText, true);
	$out = $htmlDiff->outputDiff();
	//Then
	$out->toString();//to get the compared version
	//And
	$out->getModifications();//to retrieve the number of differences/modifications between the two blocks.