Alex Rivera | Logout

Colorizing Windows command line output from PHP

Asked 2011-08-16T22:50:26.243
26

To output colored text in bash, you use ANSI escape sequences.

How do you output colored text on a Windows command line, specifically from PHP?

Edit
Report

1 Answer

2

It appears that using plain escape codes won't work on the Windows command prompt. The answers on the other SO questions related to this say that you need to use the Win32 API. A Win32 API library does exist for PHP, however the documentation does have a large red section warning that it is experimental. YMMV.

answered 2011-08-17T15:02:36.753

Your Answer