note 50772 added to function.stristr

From: Date: Wed, 09 Mar 2005 15:40:36 +0000
Subject: note 50772 added to function.stristr
Groups: php.notes 
Request: Send a blank email to php-notes+get-86156@lists.php.net to get a copy of this message
You should always do a check similar to if (stristr($total, "0")!="") { as stristr returns a string, now as the zero was at the end the string returnd was:- "0" which will evaulate to a zero integer value, which is false, so just relying on the return of stristr in this case will correctly cause the if not to be entered. ---- Manual Page -- http://www.php.net/manual/en/function.stristr.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50772 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50772&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50772&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50772&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50772&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50772&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50772&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86156) next »