1. Go to this page and download the library: Download fiedsch/data_util 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/ */
fiedsch / data_util example snippets
Fiedsch\Data\Helper;
use Fiedsch\Data\Listmanager;
use Fiedsch\Data\ArrayRecordCreator;
// use Helper::expandExpression() et al.
// use Listmanager to perform operations on lists (arrays)
// use ArrayRecordCreator to create data records
// use Helper::columnIndex() and Helper::columnName() for column name to numerical index mappings
$listA = ['a','b','c'];
$listB = ['c','d','e'];
$manager = new Listmanager($listA);
$result = $manager->without($listB); // ['a', 'b']
$result = $manager->intersect($listB); // ['c']
$result = $manager->union($listB); // ['a','b','c','c','d','e']
$manager = new Listmanager(['a','b','c','c','b']);
$result = $manager->unique(); // ['a','b','c']
// find duplicates in a list
$list = ['a','b','a','a','c'];
$manager = new Listmanager($list);
$result = $manager->duplicates(); // ['a','a']
// $list[0] is considered unique, $list[2] and $list[3] are in the result