<html>
<body>
<p>Search an array for the value "RED", and then replace it with "pink".</p>
$arr = array("blue","red","green","yellow");
print_r(str_replace("red","pink",$arr,$i));
echo "<br>" . "Replacements: $i";
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_string_str_replace2 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:51:06 GMT -->
</html>