|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #75600 strpos($str,$find,$startpos,$endpos)
Submitted: 2017-11-30 14:22 UTC Modified: 2021-03-18 17:54 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: web at houhejie dot cn Assigned: cmb (profile)
Status: Duplicate Package: Strings related
PHP Version: Next Major Version OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: web at houhejie dot cn
New email:
PHP Version: OS:


 [2017-11-30 14:22 UTC] web at houhejie dot cn
From manual page:
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...


Test script:

Expected result:
$n==false, or $n==-1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-03-18 17:54 UTC]
-Status: Open +Status: Duplicate -Package: *General Issues +Package: Strings related -Assigned To: +Assigned To: cmb
 [2021-03-18 17:54 UTC]
This is a duplicate of feature request #52124.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 21 15:03:34 2021 UTC