PHP Classes

PHP Console Color Text: Display colored text in a terminal console

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 40 All time: 10,888 This week: 89Up
Version License PHP version Categories
consolacolortextphp 1MIT/X Consortium ...7PHP 5, Time and Date, Console
Description 

Author

This class can display colored text in a terminal console.

It can take some parameters to render text with colors and returns a text string that will make the text appear in a terminal console with the given colors with specific color names.

Currently, it supports parameters that define the text string, the background color, the foreground color, etc.

Picture of adam berger
  Performance   Level  
Name: adam berger <contact>
Classes: 23 packages by
Country: Poland Poland
Age: ???
All time rank: 74521 in Poland Poland
Week rank: 206 Up3 in Poland Poland Up
Innovation award
Innovation award
Nominee: 8x

Winner: 2x

Example

<?php
 
// "N":"B":"U":
 // BLACK Color Text
 // RED Color Text
 // GREEN Color Text
 // YELLOW Color Text
 // BLUE Color Text
 // Magenta Color Text
 // CYAN Color Text
 // WHITE Color Text
 
require_once 'src\ClassApp\ColorTextConsole.php';

 use
ConsoleColorPhp\ClassApp\ColorTextConsole;

$colorTextConsole = new ColorTextConsole("GREEN","0","0","0","N","N","color test console: GREEN");
echo
$colorTextConsole->textStringTo()."\n";
$colorTextConsole = new ColorTextConsole("MAGENTA","0","0","0","N","N","color and backgrund test console: MAGENTA ");
echo
$colorTextConsole->textStringTo()."\n";
$colorTextConsole = new ColorTextConsole("YELLOW","0","0","0","N","N","color test console: YELLOW");
echo
$colorTextConsole->textStringTo()."\n";
$colorTextConsole = new ColorTextConsole("BLUE","0","0","0","N","N","color test console: BLUE");
echo
$colorTextConsole->textStringTo()."\n";
$colorTextConsole = new ColorTextConsole("CYAN","0","0","0","N","N","color test console: CYAN");
echo
$colorTextConsole->textStringTo()."\n";
$colorTextConsole = new ColorTextConsole("GREEN","0","0","0","B","N","color and backgrund test console: GREEN and Charakter BOLD");
echo
$colorTextConsole->textStringTo()."\n";
$colorTextConsole = new ColorTextConsole("GREEN","0","WHITE","0","B","N","color and backgrund test console: GREEN and WHITE");
echo
$colorTextConsole->textStringTo()."\n";


Details

Consola Powershell Color Text To PHP

The class allows you to enter colors in the console powershell for PHP

ConsolaColorAll

This is an image


Screenshots (1)  
  • ConsolaColorAll-640px
  Files folder image Files (5)  
File Role Description
Files folder imagesrc (1 directory)
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (5)  /  src  
File Role Description
Files folder imageClassApp (1 file)

  Files folder image Files (5)  /  src  /  ClassApp  
File Role Description
  Plain text file ColorTextConsole.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 80%
Total:40
This week:0
All time:10,888
This week:89Up