PHP code example of divineomega / php-cli-progress-bar
1. Go to this page and download the library: Download divineomega/php-cli-progress-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/ */
divineomega / php-cli-progress-bar example snippets
$max = 250;
$progressBar = new DivineOmega\CliProgressBar\ProgressBar;
$progressBar->setMaxProgress($max);
for ($i=0; $i < $max; $i++) {
usleep(200000); // Instead of usleep, process a part of your long running task here.
$progressBar->advance()->display();
}
$progressBar->complete();