title: calculate differences between two numbers
body: <p>i would like to calculate the differences between two given numbers for example:<br>
  1 - 5 or 24 - 35  </p>
  
  <p>I have to separate the numbers in arrays and to write the differences between them like:<br>
  1 2 3 4 5 or 24 25 26 27 28 29 30 31 32 33 34 35  </p>
  
  <p>is there any php function that can handle that or any other php solution?  </p>
  
  <p>my code:  </p>
  
  <pre><code>$string = array('1 - 5','9','11','24 - 35'); 
  
  $arr = explode(",", $string);                        
    foreach ($arr as $val) {
      if (preg_match("/ - /", $val)) {
  
          $val = trim($val);
          $min= trim(substr($val, 0, 2));
          $max = trim(substr($val, -2));
  
        }
      }       
  </code></pre>
  
  <p>Thanks a lot!</p>