PHP code example of net_bazzline / php_component_cli_progres_bar

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

    

net_bazzline / php_component_cli_progres_bar example snippets


//assuming $items contains an array of items
$progressBar = new \Net\Bazzline\Component\Cli\ProgressBar\ProgressBar();

$progressBar->setTotalSteps(count($items));

foreach ($items as $item) {
    //do something with the item
    $progressBar->forward();
}
//to be on the save side, tell the progress bar that the show is over ;-)
$progressBar->isFinished();