title: fopen and fwrite inside for loop
body: <pre><code>for($i=0;$i&lt;$directoriesCount;$i++)
  {       
      $fileName=$Config['path']['basePath'].&quot;language/&quot;.$directories[$i].&quot;/&quot;.&quot;commontest.conf&quot;;
      $file = fopen($fileName,&quot;a&quot;);
      $data = &quot;testcontent&quot;;
      fwrite($file,&quot;\n&quot;); 
      fwrite($file,$data);
      fclose($file);
  }
  </code></pre>
  <p>the <code>$directories</code> variable will have array values:</p>
  <ol>
  <li><p>en_lang</p>
  </li>
  <li><p>fr_lang</p>
  </li>
  <li><p>it_lang, etc.,</p>
  </li>
  </ol>
  <p>in the every directory we should find the <code>commongtest.conf</code> file to write the content.</p>
  <p>In my test file its writes only the first values of array for ex 1. en_lang folder file only get <code>fwrite</code> other files not affected.</p>