title: What is the simplest way to get a ratio in PHP of multiple numbers?
body: <p>I've adapted this from an example that I found on the 'net...</p>
  
  <pre><code>function ratio($a, $b) {
      $_a = $a;
      $_b = $b;
  
      while ($_b != 0) {
  
          $remainder = $_a % $_b;
          $_a = $_b;
          $_b = $remainder;   
      }
  
      $gcd = abs($_a);
  
      return ($a / $gcd)  . ':' . ($b / $gcd);
  
  }
  
  echo ratio(9, 3); // 3:1
  </code></pre>
  
  <p>Now I want it to use <code>func_get_args()</code> and return the ratios for multiple numbers. It looks like a recursive problem, and recursion freaks me out (especially when my <em>solutions</em> infinitely loop)!</p>
  
  <p>How would I modify this to take as many parameters as I wanted?</p>
  
  <p>Thanks</p>