Re: Array_search

From: Date: Tue, 27 Apr 2004 07:07:43 +0000
Subject: Re: Array_search
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-184732@lists.php.net to get a copy of this message
On Tue, 2004-04-27 at 02:46, Ian Barnes wrote: > This is what I have done so far: > <?php > $dfile=file($cfg); > $testingstring = "#this,line,is,for,ian"; > $testing=array_search($testingstring, $dfile); > print_r ($testing); > ?> Have you tried: $testingstring = "#this,line,is,for,ian\n"; file[1] leaves newlines at the end of lines; you may need to do something else if the file is text and not in unix format. Try printing out some data from $dfile and see what you are getting. [1] http://www.php.net/file -- Adam Bregenzer adam@bregenzer.net http://adam.bregenzer.net/

« previous php.general (#184732) next »