title: PHP Exploding first part of a string into array elements and the second part into one element
body: <p>I have a string which gets exploded into an array using the space as a delimiter. Is it possible to , for example explode the first 4 words into the array and the rest into ONE array element?</p>
  
  <p>as of now the code is like this</p>
  
  <pre><code>$string = 'This is a string that needs to be split into elements';
  $splitarray = explode(' ',$string);
  </code></pre>
  
  <p>This gives an array </p>
  
  <pre><code> Array
      (
          [0] =&gt; This
          [1] =&gt; is
          [2] =&gt; a
          [3] =&gt; string
          [4] =&gt; that
          [5] =&gt; needs
          [6] =&gt; to
          [7] =&gt; be
          [8] =&gt; split
          [9] =&gt; into
          [10] =&gt; elements
  
      )
  </code></pre>
  
  <p>What i need is for the array to look like this</p>
  
  <pre><code>Array
      (
          [0] =&gt; This
          [1] =&gt; is
          [2] =&gt; a
          [3] =&gt; string
          [4] =&gt; that
          [5] =&gt; needs
          [6] =&gt; to be split into elements
  
      )
  </code></pre>
  
  <p>Is something like this possible?</p>