On Mon, 10 Sep 2001 16:41, Richard Kurth wrote:
> I am having a problem with searching through a file for a curtain
> text. Like the text below [EMAIL PROTECTED] does not exists in the file
> but when I run this it gives me a Match at line number.
> I need to run three or four names at a time through this script
> to see if they are already there. But it does not seam to work.
> And I can not figure out way. A small sample of the file is below.
>
> $fd = fopen ("virtusertable", "r");
> $line_text= "[EMAIL PROTECTED]";
> $count = 1;
> while ($line_text = fgets($fd, 2048)) {
> if ($variable = trim($line_text)) {
You are assigning here - use == for comparison.
> echo "Match at line number $count";
> break;
> }
> ++$count;
> }
>
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Figures won't lie, but liars will figure.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]