PHP command line - updating the output [duplicate]
Possible Duplicate:
Update Command-line Output, i.e. for Progress
Is it possible in PHP to update the output of PHP via command line? For instance, echo "50%";
will add that to the output, how can I make it so that it shows Updating files... 41%
but the % changes based on the progress of the script?
You have two options, either you can simply print \r or \b, \r returns you to the beginning of the line, \b goes back a single space.
If you want to have more control than this I would suggest using the curses library.
精彩评论