note 91283 added to function.strpos

From: Date: Wed, 03 Jun 2009 18:26:14 +0000
Subject: note 91283 added to function.strpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-156332@lists.php.net to get a copy of this message
I found in a certain bit of my code that under certain circumstances, $needle could be an empty string. This caused strpos to generate an error message. To get round it, I had to first test to see if $needle was an empty string, and then (ie 'else') go forward and do the strpos test if not. ---- Server IP: 92.48.74.199 Probable Submitter: 81.149.60.25 ---- Manual Page -- http://www.php.net/manual/en/function.strpos.php Edit -- https://master.php.net/note/edit/91283 Del: integrated -- https://master.php.net/note/delete/91283/integrated Del: useless -- https://master.php.net/note/delete/91283/useless Del: bad code -- https://master.php.net/note/delete/91283/bad+code Del: spam -- https://master.php.net/note/delete/91283/spam Del: non-english -- https://master.php.net/note/delete/91283/non-english Del: in docs -- https://master.php.net/note/delete/91283/in+docs Del: other reasons-- https://master.php.net/note/delete/91283 Reject -- https://master.php.net/note/reject/91283 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#156332) next »