| Search and Replacement |
| Article Index |
|---|
| Search and Replacement |
| Page 2 |
| Page 3 |
| Page 4 |
Page 4 of 4
str_replace ($search, $replace, $subject)
The function works by finding all the occurrences of $search inside $subject and replacing them with $replace.
Here's an example, which returns THRee sad men:
<?php
$haystack = 'Three merry men';
$newstr = str_replace ('merry', 'sad', $haystack);
echo "$newstr\n";
?>
This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a comment.
Tags: Simple PHP, Pear, Easy PHP, PHP Tutorial, PHP MySQL, XSLT, Sap Tutorial, CSS Tutorial, XSL FO Java, SQL Tutorial.
| Users' Comments (0) |
|
No comment posted








