title: How do I repeat a function (x times, each time unique output)?
body: <p>I'm trying to create an app that will repeat a function X number of times. Each time, the function will generate a random number. Once it generates the code, the code would then create an array with the new random numbers. Any help would be appreciated.</p>
  
  <p>I have the code that create the random number and hyphenates it, but I'm having trouble calling the function cardNumber to repeat itself x number of times and put the results in an array.</p>
  
  <pre><code>function hyphenate($str) {
      return implode("-", str_split($str, 4));
  }
  
  function cardNumber() { 
      for ($s = '', $i = 0, $z = strlen($a = 'ABCDEFGHJKLMNOPQRSTUVWXYZ')-1; $i != 2; $x =      rand(0,$z), $s .= $a{$x}, $i++);
  
      $uid = uniqid(true);
      $ccn = substr_replace($uid, $s, 0, 0);
      $upperccn = strtoupper($ccn);
      $editedccn = hyphenate($upperccn);
      return $editedccn;
  };
  
  $array = array(str_repeat(cardNumber(), 2));
  var_dump ($array);
  </code></pre>