Console_Color
[ class tree: Console_Color ] [ index: Console_Color ] [ all elements ]

Source for file color_example.php

Documentation is available at color_example.php

  1. <?php
  2. require 'Console/Color.php';
  3.  
  4. // Let's add a little color to the world
  5. // %n resets the color so the following stuff doesn't get messed up
  6. print Console_Color::convert("%bHello World!%n\n")
  7. // Colorless mode, in case you need to strip colorcodes off a text
  8. print Console_Color::convert("%rHello World!%n\n"false);
  9. // The uppercase version makes a colorcode bold/bright
  10. print Console_Color::convert("%BHello World!%n\n");
  11. // To print a %, you use %%
  12. print Console_Color::convert("3 out of 4 people make up about %r75%% %nof the " 
  13.                             ."world population.\n");
  14. // Or you can use the escape() method.
  15. print Console_Color::convert("%y"
  16.      .Console_Color::escape('If you feel that you do everying wrong, be random'
  17.                            .', there\'s a 50% Chance of making the right '
  18.                            .'decision.')."%n\n");
  19.                             
  20. ?>

Documentation generated on Mon, 11 Mar 2019 15:40:33 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.