title: PHP explode not working correctly
body: <p>This might seem trivial but it's hurting my head. Can someone explain the reason 
  The <a href="http://php.net/manual/es/function.explode.php" rel="nofollow">http://php.net/manual/es/function.explode.php</a> examples show (which I have trimmed). </p>
  
  <pre><code>$pizza  = "piece1 piece2 piece3"; // string
  $pieces = explode(" ", $pizza);
  // after a var dump
  array(3) {  [0]=&gt; string(6) "piece1" 
              [1]=&gt; string(6) "piece2" 
              [2]=&gt; string(6) "piece3" }
  </code></pre>
  
  <p>This works lovely, removes all the spaces and does a nice little array to work with, however when I use something similar shown below</p>
  
  <pre><code>$path = "/test-gallery/2/"; // string
  $urlpieces = explode("/", $path);
  // after a var dump
  array(4) {  [0]=&gt; string(0) "" 
              [1]=&gt; string(12) "test-gallery" 
              [2]=&gt; string(1) "2" 
              [3]=&gt; string(0) "" }
  </code></pre>
  
  <p>I get the first and last with an empty string. Why does it not remove the first and the last array elements? I can always add another step and remove it but the explode should take it all out shouldnt it?</p>
  
  <p>Thanks for the advice in advance.  </p>