title: Generate Batch QR codes from PHP
body: <p>I am using PHP QR Code library and it works fine to generate one QR Code. What I require is alter my php to display a bulk of QR codes which are generated from the text field (shown below) and which will be comma separated. This is the script I have:</p>
  
  <p>echo "<h1>PHP QR Code</h1><hr/>";</p>
  
  <pre><code>//set it to writable location, a place for temp generated PNG files
  $PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR;
  
  //html PNG location prefix
  $PNG_WEB_DIR = 'temp/';
  
  include "qrlib.php";    
  
  //ofcourse we need rights to create temp dir
  if (!file_exists($PNG_TEMP_DIR))
      mkdir($PNG_TEMP_DIR);
  
  
  $filename = $PNG_TEMP_DIR.'test.png';
  
  
  //processing form input
  //remember to sanitize user input in real-life solution !!!
  $errorCorrectionLevel = 'L';
  if (isset($_REQUEST['level']) &amp;&amp; in_array($_REQUEST['level'], array('L','M','Q','H')))
      $errorCorrectionLevel = $_REQUEST['level'];    
  
  $matrixPointSize = 4;
  if (isset($_REQUEST['size']))
      $matrixPointSize = min(max((int)$_REQUEST['size'], 1), 10);
  
  
  if (isset($_REQUEST['data'])) { 
  
      //it's very important!
      if (trim($_REQUEST['data']) == '')
          die('data cannot be empty! &lt;a href="?"&gt;back&lt;/a&gt;');
  
      // user data
      $filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png';
      QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2); 
  
  
  } else {    
  
      //default data
      echo 'You can provide data in GET parameter: &lt;a href="?data=like_that"&gt;like that&lt;/a&gt;&lt;hr/&gt;';    
      QRcode::png('PHP QR Code :)', $filename, $errorCorrectionLevel, $matrixPointSize, 2);
  
  
  }    
  
  //display generated file
  echo '&lt;img src="'.$PNG_WEB_DIR.basename($filename).'" /&gt;&lt;hr/&gt;'; 
  </code></pre>
  
  <p>echo $filename;     </p>
  
  <pre><code>//config form
  echo '&lt;form action="index.php" method="post"&gt;
      Data:&amp;nbsp;&lt;input name="data" value="'.(isset($_REQUEST['data'])?htmlspecialchars($_REQUEST['data']):'PHP QR Code :)').'" /&gt;&amp;nbsp;
      ECC:&amp;nbsp;&lt;select name="level"&gt;
          &lt;option value="L"'.(($errorCorrectionLevel=='L')?' selected':'').'&gt;L - smallest&lt;/option&gt;
          &lt;option value="M"'.(($errorCorrectionLevel=='M')?' selected':'').'&gt;M&lt;/option&gt;
          &lt;option value="Q"'.(($errorCorrectionLevel=='Q')?' selected':'').'&gt;Q&lt;/option&gt;
          &lt;option value="H"'.(($errorCorrectionLevel=='H')?' selected':'').'&gt;H - best&lt;/option&gt;
      &lt;/select&gt;&amp;nbsp;
      Size:&amp;nbsp;&lt;select name="size"&gt;';
  
  for($i=1;$i&lt;=10;$i++)
      echo '&lt;option value="'.$i.'"'.(($matrixPointSize==$i)?' selected':'').'&gt;'.$i.'&lt;/option&gt;';
  
  echo '&lt;/select&gt;&amp;nbsp;
      &lt;input type="submit" value="GENERATE"&gt;&lt;/form&gt;&lt;hr/&gt;';
  </code></pre>
  
  <p>What I need is in the input field called 'value' I will be able to type a series of information separated by comma then be presented with a list of QR barcodes generated from the comma separated list I specify.</p>
  
  <p>Thanks</p>