title: PHP: Split header into spans
body: <p>I have a simple content rotator that displays text like so:</p>
  
  <pre><code>&lt;h4&gt;&lt;span&gt;Featured Article&lt;/span&gt;&lt;/h4&gt; 
                          &lt;h2&gt;&lt;span&gt;Lorem ipsum dolor sit amet,&lt;/span&gt; &lt;span&gt;consectetur adipisicing elit&lt;/span&gt;&lt;/h2&gt; 
                          &lt;span class="author"&gt;by Cameron Drysdale&lt;/span&gt;
  </code></pre>
  
  <p>As you can see the h2 has it's text split up into <code>&lt;span&gt;</code> tags. This is so I can achieve the following effect as seen here on the pink box: <a href="http://www.paperviewmagazine.com/" rel="nofollow">http://www.paperviewmagazine.com/</a></p>
  
  <p>The problem is how to do this automatically as the header will be generated from a database and will not have the span tags by default. Any ideas on how I could use PHP to add in some tags to wrap certain parts of a title?</p>
  
  <p><strong>EDIT: I'm using WordPress and so the title would be shown like <code>&lt;?php the_title(); ?&gt;</code> and I'd probably want to split the text after x number of characters</strong></p>
  
  <p><strong>EDIT2: I should note that the idea is to split the content using span tags so this could also be a possibility: <code>&lt;span&gt;this is&lt;/span&gt; &lt;span&gt;some text&lt;/span&gt; &lt;span&gt;I'm sharing&lt;/span&gt;</code></strong></p>