ID: 23939
User updated by: tony at marston-home dot demon dot co dot uk
Reported By: tony at marston-home dot demon dot co dot uk
-Status: Feedback
+Status: Closed
Bug Type: Strings related
Operating System: WindowsXP
PHP Version: 4.3.2
New Comment:
Ignore this - I found my mistake.
Previous Comments:
------------------------------------------------------------------------
[2003-06-01 13:49:09] [EMAIL PROTECTED]
I cannot confirm this:
<?php
$h = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
$p1 = strpos($h, 's');
$p2 = stripos($h, 's');
echo "strpos position $p1 gives me " . $h{$p1};
echo "\n";
echo "stripos position $p2 gives me " . $h{$p2};
?>
Outputs:
strpos position 44 gives me s
stripos position 18 gives me S
Can you double check?
Tested: Linux, PHP 4.3.2 / 5.0.0
------------------------------------------------------------------------
[2003-06-01 13:31:33] tony at marston-home dot demon dot co dot uk
$haystack contains
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
so why does $pos = strpos($haystack, 's'); return me the position of
'S' instead of 's'?
If I wanted a case insensitive search I would use stripos instead.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23939&edit=1