|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-08-14 15:37 UTC] cmb@php.net
-Status: Open
+Status: Suspended
[2018-08-14 15:37 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
Description: ------------ I think we need a better strpos that can find multiple positions (an array) quickly. to avoid the use of functions like : $str = "&foobar&foobaz"; $toFind = "foo"; $start = 0; while( ($pos = strpos(($str),$toFind,$start) !== false)) { echo 'Found '.$toFind.' at position '.$pos."\n"; $start = $pos+1; // start searching from next position. } //Output: // Found foo at position 1 // Found foo at position 8 Expected result: ---------------- an array of all positions Actual result: -------------- a simple position