title: code was working, but suddenly stopped working
body: <p>This code opens a text file, then checks to see if each word in the text file
  Exists in a another large 2MB dictionary file. </p>
  
  <p>If it does exist, it stores the line from the dictionary file into a variable.</p>
  
  <p>The code was working, but then began to generate Server 500 errors, and now
  It only lists about 7 matches and then loads nothing forever.</p>
  
  <p>It used to list the 1000's of matches and then stop.</p>
  
  <pre><code>$file_handle = fopen("POSdump.txt", "r");
  while (!feof($file_handle)) {
     $line = fgets($file_handle);
  
     $words= explode(" ", $line ); 
  
     foreach ($words as $word) {
  
         $word = preg_replace('#[^\w+&gt;\s\':-]#', ' ', $word);                
  
         $subwords= explode(" ", $word );
  
         $rawword = $subwords[0];   
         $poscode = $subwords[1];
         $rawword = strtoupper($rawword);       
  
  
               $handle = fopen("dictionary.txt","r"); // 
  
               if ($handle) {
                 while (!feof($handle)) 
                             {
                        $buffer = fgets($handle, 4096); 
  
                          if (preg_match('#\b'.$rawword.'\b#',$buffer)) {
  
  
                          echo $rawword;
              echo "&lt;/br&gt;";
  
  
                   }
               }
           }
       }
  }
  
  ?&gt;
  </code></pre>