Re: Simple code that won't work

From: Date: Tue, 17 Dec 2002 14:57:59 +0000
Subject: Re: Simple code that won't work
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-128569@lists.php.net to get a copy of this message
On Tuesday 17 December 2002 22:25, Jacob van Zanen wrote: > Hi All, > > > Reasonably new to PHP and trying to write a code that looks through my > logfiles and reports the lines that contain any of the keywords in my init > file. > However can't seem to get it to work > > <? > // Open an ini file > if (!($IniContent = file("d:\MyPhp\initORA.ini"))) > { > Print ("File could not be opened"); > exit; > } > if (!($FileContent = file("d:\MyPhp\\test.ora"))) > { > Print ("File could not be opened"); > exit; > } > while (list ($LineNum, $Line) = each ($FileContent)) > { > while (list($KeyNum, $IniParm) = each($IniContent)) > { > if (strstr($Line,$IniParm)) > { > print ("$Line"); > } > } > } > ?> > > If the part that does not seem to work is the bit that does the > comparison. '=' is an assignment operator, what you want is '==' which is the equality operator. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Do you mean that you not only want a wrong answer, but a certain wrong answer? -- Tobaben */

« previous php.general (#128569) next »