title: PHP: insert text up to delimiter
body: <p>I have a bunch of chat logs that look like this:</p>
  
  <pre><code>name: some text
  name2: more text
  name: text
  name3: text
  </code></pre>
  
  <p>I want to highlight the just the names. I wrote some code that should do it, however, I was wondering if there was a much cleaner way than this:</p>
  
  <pre><code>$line= "name: text";
  $newtext = explode(":", $line,1);
  $newertext = "&lt;font color=red&gt;".$newtext[0]."&lt;/font&gt;:";
  $complete = $newertext.$newtext[1];
  echo $complete;
  </code></pre>