str_replace() function replaces some characters in a string with other characters (case sensitive). This article focuses on introducing you to the four uses of the PHP string replacement str_replace() function. Friends who are interested should take a look.
The following article will share with you the four uses of the PHP string replacement str_replace() function. The specific content is as follows:
mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )
This function returns a String or array. This string or array is the result of replacing all searches in the subject with replace.
1. $search, the string or array to be replaced
2. $replace, the string or array to be replaced
3. $subject, The string or array being queried
4. $count, optional, if specified, will be set to the number of replacements
5. Return value: This function returns the replaced array Or string (newly generated)
Summary
The above is the detailed content of Introduction to the use of php string replacement str_replace() function. For more information, please follow other related articles on the PHP Chinese website!