title: PHP Breaking string into smaller form factor
body: <p>I am busy with an online booking system. After a user selected all his/her seats, the end string to save into my DB looks like this:</p>
  
  <blockquote>
    <p>SH1, SH2, SH3, SH4, SH6, SH7, SH8, SI1, SI2, SI3, SI4, SI5, SI7, SP1, SP2, SP3, SQ1, SQ2, SQ3, SQ4, A1, A2, A3, A4, A5</p>
  </blockquote>
  
  <p>But I need to break it down into something like this:</p>
  
  <blockquote>
    <p>SH1-4, SH6-8, SI1-5, SI7, SP1-3, SQ1-4, A1-5</p>
  </blockquote>
  
  <p>If someone could help me with a short example please.</p>