ID:               23939
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tony at marston-home dot demon dot co dot uk
-Status:           Open
+Status:           Feedback
 Bug Type:         Strings related
 Operating System: WindowsXP
 PHP Version:      4.3.2
 New Comment:

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



Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to