title: PHP get part of string to new array?
body: <p>If I have an array in the following format, how can I assign part of these array values in to a new array?
  (Numeric value <code>123</code> and <code>654</code> indicate that the array can be separated in these locations)</p>
  
  <pre><code>$fruits = array();
  $vehicles = array();
  $all_words = array ("123", "apple", ”orange”, ………, ”bannana”, ”123”, ”654”, ”car”, ”bus”, ………, ”train”, ”bike”, ”654”); 
  //continuous ……… Indicate there can be unknown amount of array elements.
  //Also, these numeric values of 123 and 645 can be changed to something convenient 
  </code></pre>
  
  <p>I can see that using <code>$fruits = array_slice($array, 1, 5)</code>   I can get a portion of this array in to a new one. But if I don’t know the length of array between two numbers(<code>123</code> and <code>654</code>, how can I assign these values in to an new array?</p>