#44427 [Fbk->Csd]: stripos() and strpos() do not return false when needle is not found
| From: | garichner at i2pmail dot org | Date: | Thu, 13 Mar 2008 12:38:41 +0000 |
| Subject: | #44427 [Fbk->Csd]: stripos() and strpos() do not return false when needle is not found | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-123274@lists.php.net to get a copy of this message | ||
ID: 44427
User updated by: garichner at i2pmail dot org
Reported By: garichner at i2pmail dot org
-Status: Feedback
+Status: Closed
Bug Type: Strings related
Operating System: S.u.S.E. 10.3
PHP Version: 5.2.5
New Comment:
foreach ($buffer_Infile1 as $VAL1) {
foreach ($VAL1 as $VAL2){
$VAL2=trim($VAL2);
$POSP=stripos($VAL2,".");//<<<<<<<<
echo $VAL2." ".$POSP."\n";
}
this is the output
s.schaefer 1
sschaefer
solved
Previous Comments:
------------------------------------------------------------------------
[2008-03-13 11:54:47] jani@php.net
Please provide a short but _complete_ reproducing script. (one that
starts with <?php, ends with ?> and can be simply copy'n'pasted to run.
------------------------------------------------------------------------
[2008-03-13 10:31:19] garichner at i2pmail dot org
Description:
------------
stripos strpos don't do false on needle not found
foreach ($buffer_Infile1 as $VAL1) {
foreach ($VAL1 as $VAL2){
$VAL2=trim($VAL2);
$POSP=stripos($VAL1[0],".");
echo $VAL2." ".$POSP."\n";
}
does this
s.schaefer 1
sschaefer 1
but should to this
s.schaefer 1
sschaefer 0
Reproduce code:
---------------
foreach ($buffer_Infile1 as $VAL1) {
foreach ($VAL1 as $VAL2){
$VAL2=trim($VAL2);
$POSP=stripos($VAL1[0],".");
echo $VAL2." ".$POSP."\n";
}
Expected result:
----------------
s.schaefer 1
sschaefer 0
Actual result:
--------------
s.schaefer 1
sschaefer 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44427&edit=1