Javatpoint Logo
Javatpoint Logo

PHP string str_ireplace() Function

PHP string str_ireplace() is predefined function. It is used to replace some character with some other characters. It is case-insensitive version of str_replace().

Note: This function is binary-safe.


Parameter Description Required/Optional
find Specify the value to find. Required
replace Specify the value to replace. Required
string Specify the string to be searched Required
Count It is variable that counts the number of replacement. Optional

Example 1

with using 'str_ireplace()' functionL:('PHP','JAVA','PYTHON','RUBY') By using 'str_ireplace()' function: PYTHON!


Your array string is: array('PHP','JAVA','PYTHON','RUBY')
Array ( [0] => JAVA [1] => JAVA [2] => PYTHON [3] => RUBY ) Replacements: 1

Example 3


Before using 'str_ireplace()': array('PHP','JAVA')
After using 'str_ireplace()':array('PHP','java','!')
Array ( [0] => B [1] => [2] => ! )

Next TopicPHP String

Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA