Req #75600 [NEW]: strpos($str,$find,$startpos,$endpos)
From: web at houhejie dot cn
Operating system:
PHP version: Next Major Version
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:strpos($str,$find,$startpos,$endpos)
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 bug report at https://bugs.php.net/bug.php?id=75600&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75600&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75600&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75600&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75600&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75600&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75600&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75600&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75600&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75600&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75600&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75600&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75600&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75600&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75600&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75600&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75600&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75600&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75600&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75600&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75600&r=mysqlcfg
Thread (2 messages)
- web at houhejie dot cn