<!DOCTYPE html>
<html>
<body>
<?php
$arr = array("blue","red","green","yellow");
print_r(str_replace("red","pink",$arr,$i));
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>