title: PHP: Is there a simple way to parse a list of numbers (as a string, like "1-3,5,7-9") into an array?
body: <p>I tried searching for this both here and on Google, so if I missed something obvious, I apologize.  It's possible I simply don't know the name for the formatting of these numbers.</p>
  
  <p>What I'm looking to do is to start with a string, like "1-3,5,7-9" and have it turn into a PHP array with the following entries: 1,2,3,5,7,8,9</p>
  
  <p>I know how to do this by using preg_split on a comma, then iterating through and expanding any - marks, but I feel like there must be an easier/better way.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I didn't make this clear, but the string needs to include SPANS!  That means if my string was "1-9" my resulting array should be "1,2,3,4,5,6,7,8,9" NOT JUST "1,9".  Sorry for that not being clear before.</p>