title: How to split an array based on a certain value?
body: <p>I currently have an array of location based information similar to below (which is already sorted by time). The first key/value is event which represents the start of a journey (00), a running journey (01) and an end of a journey (10).</p>
  
  <pre><code>Array ( 
  [0] =&gt; Array ( [event] =&gt; 00 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [1] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [2] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [3] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [4] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [5] =&gt; Array ( [event] =&gt; 10 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [6] =&gt; Array ( [event] =&gt; 00 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [7] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [8] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [9] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [10] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [11] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [12] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [13] =&gt; Array ( [event] =&gt; 10 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [14] =&gt; Array ( [event] =&gt; 00 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [15] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [16] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [17] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [18] =&gt; Array ( [event] =&gt; 10 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  )
  </code></pre>
  
  <p>How can I split the array even further so it creates a new array for every journey so I would end up with this:</p>
  
  <pre><code>Array (
  [0] =&gt; Array (
  [0] =&gt; Array ( [event] =&gt; 00 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [1] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [2] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [3] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [4] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [5] =&gt; Array ( [event] =&gt; 10 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  )
  [1] =&gt; Array (
  [0] =&gt; Array ( [event] =&gt; 00 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [1] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [2] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [3] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [4] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [5] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [6] =&gt; Array ( [event] =&gt; 01 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  [7] =&gt; Array ( [event] =&gt; 10 [time] =&gt; 1329293878 [lat] =&gt; 66.66666 [lon] =&gt; 11.11111 )
  )
  ...
  )
  </code></pre>
  
  <p>I haven't tried anything yet (except for googling) as I don't really know where to start.</p>