<?php $fp = fopen ('1.txt', 'r'); while (!feof ($fp)) { $temp = fgets ($fp, 4096); if (preg_match('/pass/',$temp)) echo $temp . "\r\n"; } fclose ($fp); ?>