All pastes #27541 Raw Edit

Unnamed

public text v1 · immutable
#27541 ·published 2005-11-03 21:50 UTC
rendered paste body
        function findLine($file, $string){
                $fres = @fopen($file, 'r');
                if($fres){
                        while(!feof($fres)){
                                $buffer = fgets($fres, 4096);
                                if( stripos($buffer, $string) ){
                                        echo $buffer, '<br />';
                                }
                        }
                        fclose($fres);
                } else{
                        echo '<p style="color: red;">WARNING: File ', $file, ' could not be opened.</p>';
                }
        }