title: how do I combine consecutive month names in php?
body: <p>I have an array like: </p>
  
  <pre><code>Array
  (
      [0] =&gt; Jan
      [1] =&gt; Feb
      [2] =&gt; Mar
      [3] =&gt; Apr
      [4] =&gt; May
      [5] =&gt; Jun
      [6] =&gt; Sep
      [7] =&gt; Oct
      [8] =&gt; Dec
  )
  </code></pre>
  
  <p>I need to convert it to</p>
  
  <pre><code>Array
  (
      [0] =&gt; "Jan - Jun"
      [1] =&gt; "Sep - Oct"
      [2] =&gt; "Dec"
  )
  </code></pre>
  
  <p>The months will always be in order, but since the array is dynamic, I can't think of a good efficient way to this, other than converting each month to number with date_parse and then combine with the months around it! but I am  really confused as to how to do this, any ideas?</p>