title: php split array between two values
body: <p>i have an array like:</p>
  
  <pre><code>Array ( [0] =&gt; #!A1#DC [1] =&gt; #IMSR102.71/74.82 [2] =&gt; #HV50 [3] =&gt; #PR7/7/ [4] =&gt; #RX0 [5] =&gt; #ERN/1//0 [6] =&gt; #Q2 [7] =&gt; #!A1#DC [8] =&gt; #IMSR102.50/74.82 [9] =&gt; #HV40 [10] =&gt; #PR5/5/ [11] =&gt; #RX0 [12] =&gt; #ERN/1//1 [13] =&gt; #Q2 etc etc with hundreds o values
  </code></pre>
  
  <p>i get this array from a file (with the function file($filename) ) and i need to split it in many subarray.</p>
  
  <p>"!A1#DC" this is the beginning of a series of values ​​that ends with #Q2 but the number of the values between the beginning and the end is not always the same and the only 2 values that are same are the two given ("!A1#DC" for the beginning and "#Q2" for the end)
  how can i get somethings like this?</p>
  
  <pre><code>Array ( 
  [0] =&gt; Array (  [0] =&gt; #!A1#DC [1] =&gt; #IMSR102.71/74.82 [2] =&gt; #HV50 [3] =&gt; #PR7/7/ [4] =&gt; #RX0 [5] =&gt; #ERN/1//0 [6] =&gt; #Q2 ) 
      [1] =&gt; Array (
       [1] =&gt; #!A1#DC [2] =&gt; #IMSR102.50/74.82 [3] =&gt; #HV40 [4] =&gt; #PR5/5/ [5] =&gt; #RX0 [6] =&gt; #ERN/1//1 [7] =&gt; #Q2 etc etc
  </code></pre>
  
  <p>could you please help me?</p>
  
  <p>thanks</p>