Color lines in a string

Anybody know how to get an array with the line breaks on a string to color the lines just like http://forums.devnetwork.net/viewtopic.php?f=38&p=489223 ??