PHP code example of michaeltintiuc / percentilerank-example

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

    

michaeltintiuc / percentilerank-example example snippets


/**
 * @param string type of parser
 */
$app = new MichaelT\App('csv');

/**
 * @param string path to file
 */
$app->parser()->loadFile(__DIR__.'/../input.csv');

/**
 * @param string|int index/key of score of interest
 * @param string|int index/key to hold percentile rank
 */
$data = $app->calculateRank(2, 'rank');

/**
 * @param string path to file
 * @param array data to save
 * @param string|int|array key/index of array to skip
 */
$app->parser()->exportFile(__DIR__.'/../output.csv', $data, 0);
bash
php public/index.php