Table of Contents
The str_replace() function is an built-in function in PHP which is used to replaces any portion of a string with another string. This function is binary-safe.
Note:
This function is case-sensitive. You can use the str_ireplace() function for case-insensitive search.
Syntax:
find – This parameter is required. It specifies the value to find.
replace – This parameter is required. It specifies the value to replace the value in find.
string – This parameter is required. It specifies the string to be searched.
count – This parameter is optional. A variable that counts the number of replacements.
Example: