|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-06-01 13:31 UTC] 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 21:00:01 2025 UTC |
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