Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am siklosi on github.
  • I am siklosi (https://keybase.io/siklosi) on keybase.
  • I have a public key ASAQmCjwa7OWcal21ctOkAYfT6328Y91O62C2-Dh_0cvgwo

To claim this, I am signing this object:

@siklosi
siklosi / progress_bar.php
Created May 31, 2018 07:56 — forked from mayconbordin/progress_bar.php
PHP CLI progress bar in 5 lines of code
<?php
function progress_bar($done, $total, $info="", $width=50) {
$perc = round(($done * 100) / $total);
$bar = round(($width * $perc) / 100);
return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info);
}