PHP code example of mshumakov / decomposer
1. Go to this page and download the library: Download mshumakov/decomposer 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/ */
mshumakov / decomposer example snippets
declare(strict_types=1);
use MSdev\Helper\Decomposer;
10; // Fragment size
$totalCount = count($data); // Total amount of data
$params = [
'hello' => 'world'
];
/**
* In the response, we return the passed parameters
* ($params) and a list of fragments (key - 'list').
*
* p.s.: More information in the tests.
*/
$decomposer = new Decomposer();
$fragments = $decomposer->decompose(
$batchSize,
$totalCount,
$params
);