note 51060 added to function.stristr

From: Date: Fri, 18 Mar 2005 13:59:16 +0000
Subject: note 51060 added to function.stristr
Groups: php.notes 
Request: Send a blank email to php-notes+get-86621@lists.php.net to get a copy of this message
Be careful never to use integer value as a needle - always convert it to string before use e.g. using strval() - otherwise you'll get messed up - for example te following: if ($res=stristr('40', 52)) echo $res; will return '40' as $res - simply 52 is the ASCII code of '4' that's in the beginning of our string. Actually that's covered in the description of the function but you may miss to pay attention to it just like me=] ---- Manual Page -- http://www.php.net/manual/en/function.stristr.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51060 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51060&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51060&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51060&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51060&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51060&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51060&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86621) next »