September 2001
Intermediate to advanced
768 pages
32h 45m
English
string str_replace(string find, string replace, string string)
Replaces all occurrences of find within string with replace.
Returns:
String
Description:
str_replace() replaces all instances of find within string with replace .
Version:
PHP 3.0.6+, PHP 4+
See also:
Other methods of replacing characters in a string:
str_replace() strtr()
The regular expression functions
Example:
<?php
$string = "For more on frobjigget mangling, see frobnagle() (q.v.).";
echo str_replace (' (q.v.)', '', $string);
?>
Output:
For more on frobjigget mangling, see frobnagle().
|
Read now
Unlock full access