WMMEGA FW >= 2.1188
Replace all occurrences of the search string with the replacement string
This function returns a string or an array with all occurrences of search in subject replaced with the given replace value.
$search: The string to search for
$replace: The string to replace with
$subject: The string with the search strings to be replaced
&$count: [Optional] A pointer to an int which will contain the number of replacements made. Make sure you pass this with a & before the variable (pass by reference)
string: A string based on $subject with all the search strings replaced by their replacement strings.
<? $str="Hello world, you are the nicest world that I know."; $result=str_replace("world", "chick", $str); $result=str_replace("Hello", "Goodbye", $result); print($result); ?>
<? $string1="This is a fine time to eat. It really is."; $cnt=0; $str=str_replace("is","",$string1,&$cnt); print($str); print("\r\nReplaced ".$cnt." times"); ?>
Output is:
Th a fine time to eat. It really . Replaced 3 times
charat() - Return the ASCII code for a character in a string at an index
strlen() - Return the length of a string
strrpos() - Return the position of the last occurrence of a needle in a haystack
strtolower() - Return the lowercase version of a string
strtoupper() - Return the UPPERCASE version of a string
substr() - Return part of a string
ucfirst() - Convert a string to lowercase except for the first character