title: How to separate sets of numbers onto separate lines
body: <p><strong>About the script:</strong></p>
  
  <p>The script below will create 300 <strong>sets</strong> of random characters.</p>
  
  <p>What is presently happening, is that it creates them but shows them all on one line, in one big chunk.</p>
  
  <p>With all the searching and testing I've done to try and achieve this, I have had no success.</p>
  
  <p>I would like to know which code and where to put it, so that each SET (300) of 15 characters long, will show and be saved to file.</p>
  
  <p><strong>Here is my script:</strong></p>
  
  <pre><code>&lt;?php
  
  function GetID($x){
  
  $characters = array_merge(range('A','Z'),range('a','z'),range(2,9));
  shuffle($characters);
  
  
  for($x=0;$x&lt;=299;$x++){
  
  }
  
  for (; strlen($ReqID)&lt;$x;){
  $ReqID .= $characters[mt_rand(0, count($characters))];
  }
  
  
  return $ReqID;
  }     
  
  $ReqID .= GetID(5);
  $ReqID .= "-";
  $ReqID .= GetID(5);
  $ReqID .= "-";
  $ReqID .= GetID(5);
  
  
  echo $ReqID;
  
  
  $fh = fopen("file.txt","a+");
  fwrite($fh, ("$ReqID")."\n");
  fclose($fh);
  
  ?&gt;
  </code></pre>