fopen multiple files in php
问题 I'm trying to make my PHP script open more than 1 text document and to read them. My current script is as follows: <?php //$searchthis = "ignore this"; $matches = array(); $FileW = fopen('result.txt', 'w'); $handle = @fopen("textfile1.txt", "r"); ini_set('memory_limit', '-1'); if ($handle) { while (!feof($handle)) { $buffer = fgets($handle); if(stripos($buffer, $_POST["search"]) !== FALSE) $matches[] = $buffer; } fwrite($FileW, print_r($matches, TRUE)); fclose($handle); } ?> I'm trying to