<?php
$arr = array("blue","red","green","yellow");
print_r(str_replace("red","pink",$arr,$i)
);
echo "Replacements: $i";
?>
输出:
Array ( [0] => blue [1] => pink [2] => green [3] => yellow )
<?php
$arr = array("blue","red","green","yellow");
print_r(str_replace("red","pink",$arr,$i)
);
echo "Replacements: $i";
?>
输出:
Array ( [0] => blue [1] => pink [2] => green [3] => yellow )