|
Posted by d on 11/18/13 11:43
"Rex" <eric.fiori@gmail.com> wrote in message
news:1143445129.437173.181710@t31g2000cwb.googlegroups.com...
>I believe you want to read the file line by line and then try and match
> your regex to each line. try:
>
> $handle = @fopen("dummy.txt", "r");
> if ($handle) {
> while (!feof($handle)) {
> $buffer = fgets($handle);
> if( !preg_match('/^b.*?\n/',$buffer) )
> echo $buffer . "<br>";
> }
> fclose($handle);
> }
You could use substr($buffer, 0, 1)=="b" as opposed to preg_match, as
preg_match is a bit more intensive than just substr...
Navigation:
[Reply to this message]
|