Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

str_replace()

3 tags 1 category

str_replace() — Replace all occurrences of the search string with the replacement string.

str_replace() — This function returns a string or an array with all occurrences of search in subject replaced with the given replace value.

To replace text based on a pattern rather than a fixed string, use preg_replace.

Inputs: search: The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles. replace: The replacement value that replaces found search values. An array may be used to designate multiple replacements. subject: The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well. count: If passed, this will be set to the number of replacements performed.

Returns: This function returns a string or an array with the replaced values.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…