|  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: -
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:
Status: Open Package: *General Issues
PHP Version: Next Major Version OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Mar 08 21:01:23 2021 UTC