Clear PHP CLI output

前端 未结 10 1943
一整个雨季
一整个雨季 2020-11-29 22:15

I\'m trying to get a \"live\" progress indicator working on my php CLI app. Rather than outputting as

1Done
2Done
3Done

I would rather it c

10条回答
  •  被撕碎了的回忆
    2020-11-29 22:43

    Console functions are platform dependent and as such PHP has no built-in functions to deal with this. system and other similar functions won't work in this case because PHP captures the output of these programs and prints/returns them. What PHP prints goes to standard output and not directly to the console, so "printing" the output of cls won't work.

提交回复
热议问题