Re[4]: [PHP] erge on a text file

From: Date: Sun, 10 Sep 2000 22:00:38 +0000
Subject: Re[4]: [PHP] erge on a text file
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-16086@lists.php.net to get a copy of this message
I changed it to this when I tried it and it still does not work Do I need to open the file first with fopen. $number ="1000001"; this number is not in the file $data = file("d:\\www.twohot.com\\northwest\\data1.txt"); for($a=0;$a<count($data);$a++){ if($number = $data[$a]){ echo "The number has been found"; $found = 1; } } if(!$found){ echo "The number was not found"; } Sunday, September 10, 2000, 3:21:07 PM, you wrote: JAC> but $webfile = "data1.txt" just assigns the text value "data1.txt" to JAC> the JAC> variable $webfile. JAC> you should first load the contents of data1.txt into $webfile. JAC> try using $webfile = file("data1.txt") /* This returns an array of lines of JAC> data1.txt */

« previous php.general (#16086) next »