Req #64259 [Opn->Sus]: Create strn_replace() function
Edit report at https://bugs.php.net/bug.php?id=64259&edit=1
ID: 64259
Updated by: cmb@php.net
Reported by: d at duane dot com
Summary: Create strn_replace() function
-Status: Open
+Status: Suspended
Type: Feature/Change Request
Package: Strings related
Operating System: Linux
PHP Version: 5.4.11
Block user comment: N
Private report: N
New Comment:
If you, or anybody else for that matter, is still interested in
this feature, please pursue the RFC process[1]. For the time
being, I suspend this ticket.
[1] <https://wiki.php.net/rfc/howto>
Previous Comments:
------------------------------------------------------------------------
[2013-02-21 00:07:30] d at duane dot com
Description:
------------
It'd be great to have a version of str_replace() that can be configured to work
on a specified number of replacements.
I propose that the function
mixed strn_replace ( mixed $search , mixed $replace , mixed $subject, int
$repetitions, [, int &$count ] )
Be created, which would do the same thing as str_replace() but only as many
times as $repetitions was set to.
See further discussion of the ways this problem is currently solved.
http://stackoverflow.com/questions/1252693/php-str-replace-that-only-acts-on-
the-first-match
I am up for adding this code in as a patch, but it'd be nice to have some
feedback if this is desired.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64259&edit=1
Thread (2 messages)