Re: strpos problem

From: Date: Wed, 16 Feb 2000 17:00:08 +0000
Subject: Re: strpos problem
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-15594@lists.php.net to get a copy of this message
On Wed, Feb 16, 2000 at 07:26:47PM +0300, vvs_php@nsrd.npi.msu.su wrote: > > Hi! > The subject is: > the return value of strpos, if the needle is in the 0 position in the > string, it return 0, t.e. FALSE. OK? Like there is no needle in the > string. http://www.php.net/manual/function.strpos.php3 in PHP3 you would have to check the return *type* of strpos() eg: if (is_int(strpos($haystack, $needle))) { }.. in PHP4 you can use the '===' (is identical) operator to check against FASLE: if (strpos($haystack, $needle) === FALSE) { // notfound } else { // found } > > Thanx. > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

« previous php.dev (#15594) next »