|
Free
PHP Tutorials
|
![]() |
home |
Stay
at Home and Learn
|
|||||
str_replace( ) |
||||||
|
This allows you to replace one string with another. The syntaxt is: str_replace($look_for, $change_to, $search_text, match_count); The last one, match_count, is optional. It's counts how many matches it has found. In the example below, we're looking for "explore" and want to replace it with "explode". $search_text = "The explore function"; print $search_text . "<BR>"; print $changed_text; So you're looking for one string in the search text, and replacing
it with another.
|