Home > PHP > Function > Strings > str_ireplace()

str_ireplace()

str_ireplace - Case-insensitive version of

str_replace()
.

Syntax

mixed str_ireplace (mixed $search, mixed $replace, mixed $subject, int &$count)

Arguments

  • search - Note: Every replacement with search array is performed on the result of previous replacement.
  • replace
  • subject - 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 - The number of matched and replaced needles will be returned in count which is passed by reference.

Description

This function returns a string or an array with all occurrences of search in subject (ignoring case) replaced with the given replace value. If you don't need fancy replacing rules, you should generally use this function instead of preg_replace() with the imodifier.

Version

PHP 5

Return value

Returns a string or an array of replacements.