|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
9 + 17 = ?
Subscribe to this entry?

 [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: Wed Sep 22 09:03:38 2021 UTC