Created
August 15, 2012 12:17
-
-
Save aerith/3359652 to your computer and use it in GitHub Desktop.
Revisions
-
aerith created this gist
Aug 15, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ <?php function bar ($n) { return implode('', array_pad(array(), $n, '#')) . implode('', array_pad(array(), 100 - $n, '-')); } array_map(function ($i) { printf('%3d%% [|%s|]', $i, bar($i)); usleep(2000000); print "\r"; }, range(1, 100)); print "\n"; // From: // => 1% [|#---------------------------------------------------------------------------------------------------|] // To: // => 100% [|####################################################################################################|]