Current Location: Home> Function Categories> str_ireplace

str_ireplace

The case-insensitive version of str_replace
Name:str_ireplace
Category:String
Programming Language:php
One-line Description:Replace some characters in the string (case insensitive).

Definition and usage

str_ireplace() function replaces some characters in the string (case insensitive).

This function must follow the following rules:

  • If the searched string is an array, it returns an array.
  • If the searched string is an array, it will search and replace each element in the array.
  • If the array needs to be searched and replaced at the same time, and the number of elements that need to be replaced is less than the number of elements found, then the excess elements will be replaced with an empty string
  • If you search an array but replace only one string, the substitution string will work for all the found values.

Note: This function is case-insensitive. Please use str_replace() function to perform case-sensitive searches.

Note: This function is binary safe.

grammar

 str_ireplace ( find , replace , string , count )
parameter describe
Find Required. Specifies the value to be found.
replace Required. Specifies the value that replaces the value in find .
string Required. Specifies the string being searched.
count Optional. A variable that counts the replacement number.
Similar Functions
Popular Articles