ID: 42025 Comment by: jen dot bell at gmail dot com Reported By: xatyonline at gmail dot com Status: Feedback Bug Type: Strings related Operating System: Linux PHP Version: 5.2.3 New Comment:
The offset parameter of strpos is not 'how many matches to skip', it's the character index to start searching from. This should be marked as bogus. Previous Comments: ------------------------------------------------------------------------ [2007-07-18 09:10:56] [EMAIL PROTECTED] The expected result is 0 8 8 for your code, so what is the problem? ------------------------------------------------------------------------ [2007-07-18 09:01:27] xatyonline at gmail dot com Description: ------------ strpos($str, $needles, $offset); if $str haves ':', if $needles have ':', then $offset does not have mean. Reproduce code: --------------- $str = "::soon::::soon::::soon::"; for($i=0; $i<3; $i++) { echo(strpos($str, "::soon::", $i).' '); } Expected result: ---------------- Normal -------------------------------------- 0 8 16 result ---------------------------------------- 0 8 8 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42025&edit=1