|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-03-13 10:31 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 08:00:02 2025 UTC |
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