You can use Console_Color::convert to transform colorcodes like %r into ANSI control codes. print Console_Color::convert("%rHello World!%n"); would print "Hello World" in red, for example. WWW: http://pear.php.net/package/Console_Color/