Re: [BugFest] Feature request #38685: str_[i]replace(): Add support for (string needle, array replace)

From: Date: Mon, 05 Jan 2015 17:20:52 +0000
Subject: Re: [BugFest] Feature request #38685: str_[i]replace(): Add support for (string needle, array replace)
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-80187@lists.php.net to get a copy of this message
Hey François, > On 5 Jan 2015, at 17:15, F & N Laupretre <nf.laupretre@yahoo.fr> wrote: > > I just created a PR for a feature request lying around since 2006 : > > https://github.com/php/php-src/pull/980 > > It adds support in str_replace() and str_ireplace() for the combination of > (string needle, array replace). In this case, each occurrence of the needle > is replaced with an element f the 'replace' array, looping if count(replace) > is lower than count(needles) in subject. It is interesting for cyclic > replacements (alternating line colors, for instance). The PR includes the > needed tests. This would have been really useful for me quite recently, I was disappointed to see it doesn’t already work. Please go ahead with this! Thanks. -- Andrea Faulds http://ajf.me/

« previous php.internals (#80187) next »