Re: [PHP4BETA] replacing a substring
| From: | Andrei Zmievski | Date: | Sat, 20 Nov 1999 21:54:36 +0000 |
| Subject: | Re: [PHP4BETA] replacing a substring | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-6597@lists.php.net to get a copy of this message | ||
On Wed, 17 Nov 1999, Lars Torben Wilson wrote:
> May I propose a change in the argument order for substr_replace()? At
> present, the argument list is:
>
> substr_replace($string, $start [, $length [, $repl]])
>
> The way it works now is effectively that if $length is not given,
> neither may $repl be given, and nothing is done. It seems that this
> order was chosen for its relationship to substr(). I think that it
> might make more sense to go with a closer relationship to
> str_replace(), and place the needle and the haystack closer
> together. This would allow $length to be left out without affecting
> $repl:
>
> substr_replace($string, $repl [, $start [, $length]])
>
Why do you have $start optional?
-Andrei
* It's an emergent property of human minds to create. *