title: Splitting up html code tags and content
body: <p>Does anyone with more knowledge than me about regular expressions know how to split up html code so that all tags and all words are seperated ie.</p>
  
  <pre><code>&lt;p&gt;Some content &lt;a href="www.test.com"&gt;A link&lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>Is seperated like this:</p>
  
  <pre><code>array = { [0]=&gt;"&lt;p&gt;",
            [1]=&gt;"Some",
            [2]=&gt;"content",
            [3]=&gt;"&lt;a href='www.test.com'&gt;,
            [4]=&gt;"A",
            [5]=&gt;"Link",
            [6]=&gt;"&lt;/a&gt;",
            [7]=&gt;"&lt;/p&gt;"
  </code></pre>
  
  <p>I've been using preg_split so far and have either successfully managed to split the string by whitespace or split by tags - but then all the content is in one array element when I eed this to be split to.</p>
  
  <p>Anyone help me out?</p>