note 110464 added to function.strpos

From: Date: Wed, 24 Oct 2012 19:07:10 +0000
Subject: note 110464 added to function.strpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-191527@lists.php.net to get a copy of this message
Just a quick note, if by some chance you pass an array to strpos function you might have unexpected behaviour. <?php $foobar = array(); if(strpos($foobar, 'something') !== false) { } ?> The above condition will actually pass and execute your code. ---- Server IP: 192.41.42.26 Probable Submitter: 68.193.87.123 ---- Manual Page -- http://www.php.net/manual/en/function.strpos.php Edit -- https://master.php.net/note/edit/110464 Del: integrated -- https://master.php.net/note/delete/110464/integrated Del: useless -- https://master.php.net/note/delete/110464/useless Del: bad code -- https://master.php.net/note/delete/110464/bad+code Del: spam -- https://master.php.net/note/delete/110464/spam Del: non-english -- https://master.php.net/note/delete/110464/non-english Del: in docs -- https://master.php.net/note/delete/110464/in+docs Del: other reasons-- https://master.php.net/note/delete/110464 Reject -- https://master.php.net/note/reject/110464 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#191527) next »