Clear PHP CLI output -


i'm trying "live" progress indicator working on php cli app. rather outputting as

1done 2done 3done 

i rather cleared , showed latest result. system("command \c cls") doesnt work. nor ob_flush(), flush() or else i've found.

i'm running windows 7 64 bit ultimate, noticed command line outputs in real time, unexpected. warned me out wouldn't... does... 64 bit perk?

cheers help!

i want avoid echoing 24 new lines if can.

try outputting line of text , terminating "\r" instead of "\n".

the "\n" character line-feed goes next line, "\r" return sends cursor position 0 on same line.

so can:

echo "1done\r"; echo "2done\r"; echo "3done\r"; 

etc.

make sure output spaces before "\r" clear previous contents of line.

[edit] optional: interested in history & background? wikipedia has articles on "\n" (line feed) , "\r" (carriage return)


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -