PHP code example of soandso / grouping

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

    

soandso / grouping example snippets



$object = new Grouping();

$object->putSource($source_data);

$object->putSource($source_data1);
$object->putSource($source_data2);
$object->putSource($source_data3);

........

function readFile($path) {
    $handle = fopen($path, "r");

    while(!feof($handle)) {
        yield $object->putSource(sourceToarray(trim(fgets($handle))));
    }

    fclose($handle);
}


$result = $object->buildGss($output, $path_file);
bash
$ php composer.phar install
bash
$ php composer.phar 

[1]=>
  array(5) {
    ["left_border"]=>
    float(-9.4)
    ["right_border"]=>
    float(-7.85)
    ["middle_partial_interval"]=>
    float(-8.625)
    ["interval_frequency"]=>
    int(4)
    ["relative_frequency"]=>
    float(0.11428571428571)
  }
  [2]=>
  array(5) {
    ["left_border"]=>
    float(-7.85)
    ["right_border"]=>
    float(-6.3)
    ["middle_partial_interval"]=>
    float(-7.075)
    ["interval_frequency"]=>
    int(2)
    ["relative_frequency"]=>
    float(0.057142857142857)
  }
  [3]=>.....................