title: PHP: Breaking a string into multiple lines and manipulating each line separately
body: <p>I have pulled a string out of a database it contains some html code as for example:</p>
  
  <pre><code>something about thing one&lt;br&gt;
  now comes the second thing&lt;br&gt;
  we're not done yet, here's another one&lt;br&gt;
  and last but not least is the fourth one&lt;br&gt;
  </code></pre>
  
  <p>So I have four lines but when I print out the string I get an output like in the example above. What'd I'd like to do is manipulate every line so that I'd be able to do this:</p>
  
  <pre><code>&lt;span&gt;something about thing one&lt;/span&gt;
  &lt;span&gt;now comes the second thing&lt;/span&gt;
  &lt;span&gt;we're not done yet, here's another one&lt;/span&gt;
  &lt;span&gt;and last but not least is the fourth one&lt;/span&gt;
  </code></pre>
  
  <p>I'd also like to have a counter for how many lines are there in a string (like for this one there are 4 lines) so I can set "odd" and "even" class for the span.</p>
  
  <p>How do I do this?</p>