erge on a text file

From: Date: Sun, 10 Sep 2000 20:45:08 +0000
Subject: erge on a text file
Groups: php.general 
Request: Send a blank email to php-general+get-16078@lists.php.net to get a copy of this message
I am trying to get this script to look at a text file with a list of numbers a see if the number is there. Every time I run this script it tells me that it is not there even when I know that it is. Is there a better way of doing this. <?php $webfile = "data1.txt"; $number ="1494211"; if(strlen($number) != 7) { echo "Sorry, but $number is not a valid number\n"; exit; } if (ereg( $number , $webfile)){ exit; } else { echo "This not a valed number $number"; } ?> Richard

« previous php.general (#16078) next »