File loop in PHP
<p>I wrote some code to create a text file just once each time I execute the php file.
Its idea is to check all existing files with a specific name then create a text file with the previous name +1</p>

<p>For example, if there is a file called <code>filetext0.txt</code>, my code will create a file called <code>filetext1.txt</code> and so on...
Please help me to find the error in my code:</p>

<pre><code>&lt;?php
for ($i=0; $i=1000; $i=$i+1)
  {
      $handle = fopen("filetext".$i.".txt","r");
      if ($handle) {
         fclose($handle);
         $s=$i+1
         $handlex = fopen("filetext".$s.".txt","w+");
         fclose($handlex);
         break
        }
  }
?&gt;
</code></pre>
