echo "Progress : "; // 5 characters of padding at the end
for ($i=0 ; $i<=100 ; $i++) {
    echo "\033[5D"; // Move 5 characters backward
    echo str_pad($i, 3, ' ', STR_PAD_LEFT) . " %"; // Output is always5 characters long
    sleep(1); // wait for a while, so we see the animation
}

 

相关文章:

  • 2021-09-21
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2022-03-04
  • 2021-06-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-10-05
  • 2021-07-23
  • 2022-12-23
相关资源
相似解决方案