replacing a substring
| From: | Tom Fishwick | Date: | Sat, 13 Nov 1999 01:25:31 +0000 |
| Subject: | replacing a substring | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-6161@lists.php.net to get a copy of this message | ||
Hi,
Just recently I needed to replace a substring in a string, is there such
a function in PHP? I couldn't find one so ended doing two substr
operations then joining it again.
I believe in Perl it would be substr($str, pos, len) = $name
I'm not sure how often this is done, but would it be posible to add an
optional argument to substr, that if present would replace the substr
with that argument?
Tom