Created
June 10, 2019 17:55
-
-
Save ivanrosolen/31652ee2adc548860747b93e2c472b37 to your computer and use it in GitHub Desktop.
Cli Progress Bar Loop
This file contains 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 characters
#!/usr/bin/php | |
<?php | |
$iloop = "0"; | |
while (true){ | |
$warn = "Program running hold on!!\r"; | |
if (strlen($warn) === $iloop+1){ | |
$iloop = "0"; | |
} | |
$warn = str_split($warn); | |
$iloop++; | |
$warn[$iloop] = "\033[35;2m\e[0m".$warn[$iloop]; | |
echo " \033[7m".implode($warn); | |
usleep(90000); | |
} | |
// for i in {30..49};do echo -e "\033[$i;7mReversed color code $i\e[0m Hello world";done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment