Compare two Images, Texts or Files.
![Software License][ico-license]
![Total Downloads][ico-downloads], (*1)
Compare two Images, Texts or Files., (*2)
Install
Via Composer, (*3)
``` bash
$ composer require karakhanyans/comparison, (*4)
## Usage
Add Service provider into providers array in config/app.php
Karakhanyans\Comparison\ComparisonServiceProvider::class,, (*5)
``` php
$compare = new Compare();
echo $compare->images('path_to_first_image','path_to_second_image'); // will print difference percent
echo $compare->files('path_to_first_file','path_to_second_file'); // after this you can use following actions
echo $compare->differentWords(); // array with different words between two files
echo $compare->differentWordsCount(); // count of different words
echo $compare->differencePercent(); // difference in percent
echo $compare->sameWords(); // array with same words
echo $compare->sameWordsCount(); // count of same words
echo $compare->showFormattedText(); // will print different words highlighted in text
To compare texts you can use $compare->files() or $compare->texts();
Configs
You can configure formatted styles, tags etc.
By default for highlighting plugin using <b> tag and #00BB00 color
To change that you should add configs before $compare->files();
$compare->tag('pre'); // will set tag to
<
pre>
$compare->style('color:#cccccc'); // will change highlighted color
$compare->class('className'); // class name
Change log
Please see CHANGELOG for more information on what has changed recently., (*6)
Testing
bash
$ composer test, (*7)
Contributing
Please see CONTRIBUTING and CONDUCT for details., (*8)
Security
If you discover any security related issues, please email karakhanyansa@gmail.com instead of using the issue tracker., (*9)
Credits
License
The MIT License (MIT). Please see License File for more information., (*10)