I have the following code:
$data = ['a','b','c'];
$total = count($data);
for($i = 0; $i < $total; $i++) {
echo $data;
}
What I need is when the code is running in cmd
, the cmd
will output each character so that it replaces the previous character in the display, like this:
a >> then changing to show b >> then changing to show c
...only in one line.
imagine that in line 3 of cmd will show the word alternately (a -> b -> c)
I have tried with "\r" but the result is nothing in cmd. Please can you help?