note 61136 deleted from function.strpos by nlopess

From: Date: Thu, 26 Jan 2006 15:18:25 +0000
Subject: note 61136 deleted from function.strpos by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-102491@lists.php.net to get a copy of this message
Note Submitter: Steve Cambridge UK ---- I have on many occasion used strpos...but i always use a dodge to get around the 0 / false return. $findme = "a"; $haystack = "abcd"; $pos = strpos($haystack, $findme); $pos will be 0.... so i do this.... $findme = "a"; $haystack = "abcd"; $pad = "X";//or anything i ain't looking for...:P $haystack = $pad . $haystack; $pos = strpos($haystack, $findme); $pos cannot be 0..

« previous php.notes (#102491) next »