Miscellaneous
|
|
|
|
<?php #####################################################################################
### termcolored() by Joel De Gan, joeldg
### http://www.tenshimedia.com
### this function only useful for terminal run scripts.. I am not sure what this
### this would do run from a web based script.
### usage termcolored(text to output, color code);
### colors as follows for terminals..
### default = 31(red)
### 1 boldish
### 4 = underline
### 7 = highlight
### 31 = red
### 32 = green
### 33 = yellow
### 34 = blue
### 35 = purple
### 36 = light blue
### 37 = pure white
### 41 - 47 reverse 31 - 37 so 41 is red background white text
##################################################################################### function termcolored($text, $color=31){
echo exec("perl -e "print chr(27).'[01;$color m$text'.chr(27).'[00m';"");
}// end function ?>
|
|
|
Usage Example
|
|
|
Rate This Script
|
|
|
|