ID:               24113
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dave at netready dot biz
-Status:           Open
+Status:           Wont fix
 Bug Type:         Feature/Change Request
 Operating System: Linux
 PHP Version:      4.3.1
 New Comment:

preg_replace already supports this:

mixed preg_replace ( mixed pattern, mixed replacement, mixed subject [,
int limit])

regards,
Derick


Previous Comments:
------------------------------------------------------------------------

[2003-06-10 08:32:16] dave at netready dot biz

Hi, 

I have been using str_replace to search and replace over large strings.
 Replacing strings I know for certain only occur once.  I was just
thinking that maybe if there was a str_replace_once function that would
stop searching after it had replaced one instance of search string this
could save considerable time checking the rest of the string.

To make it really useful it could have a backward/forward option so If
you knew the string you are searching for occurs near the end of your
string you could search backwards for it.  Or would that be a separate
function? I'm not sure what your guidlines are on that.

This would have even more speed impact on str_ireplace because by it's
nature it is slower, so maybe a str_ireplace_once would be a good idea
too?

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24113&edit=1

Reply via email to