Req #75600 [Opn->Dup]: strpos($str,$find,$startpos,$endpos)
Edit report at https://bugs.php.net/bug.php?id=75600&edit=1
ID: 75600
Updated by: cmb@php.net
Reported by: web at houhejie dot cn
Summary: strpos($str,$find,$startpos,$endpos)
-Status: Open
+Status: Duplicate
Type: Feature/Change Request
-Package: *General Issues
+Package: Strings related
PHP Version: Next Major Version
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This is a duplicate of feature request #52124.
Previous Comments:
------------------------------------------------------------------------
[2017-11-30 14:22:57] web at houhejie dot cn
Description:
------------
---
From manual page: http://www.php.net/function.strpos
---
hope add $endpos to the function strpos, like: strpos($str,$find,$startpos,$endpos).
then we can efficient to get the result when we need to find pos in a long string, even in a file...
otherwise we need to use substr() additional...
叿å¨strpos彿°ä¸å¢å ä¸ä¸ªæªæ¢ä½ç½®åæ°ï¼åstrpos($str,$find,$startpos,$endpos)ï¼å¦åç¸å
³éæ±ä¼è°ç¨substr()å¢å å¼é
Test script:
---------------
$str="www123xxxxxxxxxxxxxxxxxxxxxxx789yyyyyyyyyyyyyyyyyyy456yyyyyyyyyyyyyyyyy";
$n=strpos($str,'456',5,20);
Expected result:
----------------
$n==false, or $n==-1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75600&edit=1
Thread (2 messages)