Parse string containing range of values to min and max variables
<p>I'm looking for a nice way to parse a string into two variables using PHP. The variables are called minage and maxage, and they should be parsed according to the examples below:</p>

<pre><code>"40" -&gt; minage=40, maxage=40
"-40" -&gt; minage=null, maxage=40
"40-" -&gt; minage=40, maxage=null
"40-60" -&gt; minage=40, maxage=60
</code></pre>
