Converting a range or partial array, in the form "3-6" or "3-6,12", into an array of integers, like 3,4,5,6,12
<p>I'm a little baffled by this one, and I'm struggling to find any similar examples online at the moment.</p>

<p>Working in PHP, I want to take input, probably from a form field, of a either a "list of values", a "range" or a combination of the two, in the form;</p>

<pre><code>3,5,6,9,11,23
</code></pre>

<p>or</p>

<pre><code>3-20
</code></pre>

<p>or</p>

<pre><code>3-6,8,12,14-50
</code></pre>

<p>I want to return these as an array of integers, so, for example</p>

<pre><code>3,4,5,6,8,12,14,15,16...
</code></pre>

<p>I won't type them all out, but the idea is quite obvious!</p>

<p>Is there either a function available that does this, or where would I start in writing one?</p>
