Storing and then printing ANSI escape sequences in (and then from) variables
| From: | Luke Slater | Date: | Wed, 07 Jan 2009 23:11:53 +0000 |
| Subject: | Storing and then printing ANSI escape sequences in (and then from) variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-285620@lists.php.net to get a copy of this message | ||
Hi,
I'm storing ANSI escape sequences in an array, stored like this:
$connections[$channel][2] = $info['colour'];
$info['$colour'] would contain something like \033[33m
Now, my problem is when I try and print it:
$pstring = $connections[$channel][2] . $connections[$channel][1] . " " . $buffer . chr(7);
It will print as a literal string, actually printing \033[33m to the screen, so how do I make it work?
I'm sure I'm missing something fatally simple here.
Thanks for your help,
Luke Slater