title: preg_match_all for words in and outside of brackets
body: <p>I have been sitting for hours to figure out a regExp for a preg_match_all function in php.
  My problem is that i whant two different things from the string.</p>
  
  <p>Say you have the string <i>"Code is fun [and good for the brain.] But the [brain is] tired."</i></p>
  
  <p>What i need from this an array of all the word outside of the brackets and the text in the brackets together as one string.</p>
  
  <p>Something like this</p>
  
  <pre><code>[0] =&gt; Code
  [1] =&gt; is
  [2] =&gt; fun
  [3] =&gt; and good for the brain.
  [4] =&gt; But
  [5] =&gt; the
  [6] =&gt; brain is
  [7] =&gt; tired.
  </code></pre>
  
  <p>Help much appreciated. </p>