PHP code example of technically-php / linear-partitioning

1. Go to this page and download the library: Download technically-php/linear-partitioning 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/ */

    

technically-php / linear-partitioning example snippets



use \TechnicallyPhp\LinearPartitioning\LinearPartitioning;

$items = [100, 200, 300, 400, 500, 600, 700, 800, 900];
$ranges = LinearPartitioning::partition($items, 3);

var_dump($ranges);
// [ [100, 200, 300, 400, 500], [600, 700], [800, 900] ]

bash
composer