The most efficient and simplest character replacement function in the php tutorial
str_replace($arr1,$arr2,$str)
Example 1:str_replace($arr1,$arr2,$str)
实例一:
<code><span>str_replace(<span>"iwind"</span>, <span>"kiki"</span>, <span>"i love iwind, iwind said"</span>)</span>; </code>
将输出 “i love kiki, kiki said
rrreee
i love kiki, kiki said
"The result is to replace all "iwind" in the original string with "kiki". str_replace is case-sensitive, so you cannot imagine using str_replace("iwind", " kiki",...) replaces "iwind" in the original string. str_replace can also implement many-to-one Definition and usagestr_replace() function uses a string to replace other characters in the string.Syntax
The article is edited and organized by the information network http://www.ziliao999.com').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });count optional. A variable counting the number of substitutions.
str_replace(find,replace,string,count) Parameter Description
find required. Specifies the value to look for.
replace required. Specifies the value to replace the value in find.
string required. Specifies the string to be searched for.
The above introduces the tellmewhen string PHP string and character replacement functions, including the tellmewhen string content. I hope it will be helpful to friends who are interested in PHP tutorials.
🎜