$input = fopen('input.txt', 'r'); $output = fopen('output.txt', 'w'); while (!feof($input)) { $line = rtrim(fgets($output), "\r\n"); if (mb_strlen($line) !== 1) { fwrite($output, $line.PHP_EOL); The code should remove lines with 1 character, but displays an empty document.
<= 1character long - Let's say Pie!==turned into<=? :) - teranfgets($output)instead offgets($input)- user218976