title: fopen write with variable issue
body: <p>small project - stumped typing to get it working - if you have any ideas please let me know tku! This post program is requiring more words so here we go</p>
  
  <pre><code>&lt;?php
  $row = 1;
  if (($handle = fopen("issue-heads-1.csv", "r")) !== FALSE) {        
  
      while (($data = fgetcsv($handle)) !== FALSE) {
  
              if ($row == 2) {
              $file = fopen($data[14], "w");
              $write = '
              &lt;?php
                  include "/home/history/public_html/issue1.php";
                  echo \'&lt;a class="prev" href="\' . $data[16] . \'"&gt;\';
              ?&gt;
              ';
              fwrite($file, $write);
              fclose($file);
              }
          $num = count($data);
  
          echo "&lt;p&gt; $num fields in line $row: &lt;br /&gt;&lt;/p&gt;\n";
          $row++;
          for ($c=0; $c &lt; $num; $c++) {
              echo $data[$c] . "&lt;br /&gt;\n";
          }
      }
      fclose($handle);
  }
  ?&gt;
  </code></pre>