<!DOCTYPE html>
<html>
<body>
<?php
$arr = array("blue","red","green","yellow");
print_r(str_ireplace("RED","pink",$arr,$i)); // Case-insensitive
echo "<br>" . "Replacements: $i";
?>
<p>In this example, we search an array to find the value "RED", and then we replace the value "red" with "pink".</p>
</body>
</html>