title: getting all the values in an array except the last one
body: <p>I have this right now : </p>
  
  <pre><code>$s = preg_split('/\s+/', $q);
      $k = end($s);
  </code></pre>
  
  <p>What I want now is to get all the values in the array <code>$k[]</code> except the last one, and join them in a new string. So basically if the array was :</p>
  
  <pre><code>0 =&gt; Hello
  1 =&gt; World
  2 =&gt; text
  </code></pre>
  
  <p>I would get <code>Hello World</code> </p>