Underlining text in Bash with #PHP

For some PHP scripts that I wrote to be run from within terminals, I figured out the control characters need to underline (and stop underlining) text from PHP.

[code] $UNDERLINE="\x1B[4m";
$REGULAR="\x1B[0m";
echo "The last word is ${UNDERLINE}underlined${REGULAR}.\n";
?>[/code]

In my own scripts, I just use $U and $R to save some typing. Anyway, enjoy, its a nice way to spruce up help messages so they’re more readable to users.

Tags: ,

Leave a Comment