note 83901 added to function.strrpos
| From: | dubayou | Date: | Tue, 17 Jun 2008 17:37:34 +0000 |
| Subject: | note 83901 added to function.strrpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140535@lists.php.net to get a copy of this message | ||
not all code is the same.
it should be coded such as
<?php
$a = "abcd";
if(is_bool(strrpos($a,"a")))
echo "Bad";
else
echo "Good";
Gives:
Good
This is how you might expect it to work, but it will fail;
<?
$a = "abcd";
if(!strrpos($a,"a"))
echo "Bad";
else
echo "Good";
Gives:
Bad
----
Server IP: 64.71.164.2
Probable Submitter: 152.20.181.12
----
Manual Page -- http://www.php.net/manual/en/function.strrpos.php
Edit -- https://master.php.net/note/edit/83901
Del: integrated -- https://master.php.net/note/delete/83901/integrated
Del: useless -- https://master.php.net/note/delete/83901/useless
Del: bad code -- https://master.php.net/note/delete/83901/bad+code
Del: spam -- https://master.php.net/note/delete/83901/spam
Del: non-english -- https://master.php.net/note/delete/83901/non-english
Del: in docs -- https://master.php.net/note/delete/83901/in+docs
Del: other reasons-- https://master.php.net/note/delete/83901
Reject -- https://master.php.net/note/reject/83901
Search -- https://master.php.net/manage/user-notes.php