views:

37

answers:

1

I'm working with the PHP CLI on windows at the moment to write some small desktop command-line apps.

I wanted to know if and how it may be possible to:

  • Clear the screen (cls would be the normal command but exec() won't work with it)
  • Change the color, change the color of parts of the output (seen this in programs before)
  • Make the command line horizontally bigger - things quickly get unreadable

Is any of the above possible from inside a PHP script?

A: 

I created a small backup script with PHP, and from what I can remember, you can print backspace characters to remove content. Not really ideal though.

Just google'd it: http://www.php.net/manual/en/features.commandline.php#77142

Josh