I am creating a conversation website. Where users enter in there conversations and to be viewed by other site visitors. I have everything done except the following:
In AOL a users convo can look like this.
geedubya15: yo whats up
malakai015 nothin... chillin. You?
geedubya15: same here
The screennames here are geedubya15 and malakai015. They are always either red or blue. I have no trouble having the screennames turning red or blue. I just entered this code.
$conversation = ereg_replace($sn1, "<font color=red>".$sn1."</font>", $conversation);
and
$conversation = ereg_replace($sn2, "<font color=blue>".$sn2."</font>", $conversation);
....
Sometimes the user has the time feature set on. Which enables them to show the time for each message. Ex:
geedubya15 (4:47:14 PM): yo whats up
malakai015 (4:47:25 PM): nothin... chillin. You?
geedubya15 (4:47:38 PM): same here
This is where I have a problem. I dont know how to make the the screennames ($sn1 and $sn2) to the 3rd : (colon) turn a color. Its not the same as the code above. Because I never will know what the time in between is going to be. So how do I make the code so that it will select everything from the Screenname to the 3rd : (colon) and make that either red or blue.