3v4l.org

run code in 300+ PHP versions simultaneously
<!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>

preferences:
42.7 ms | 402 KiB | 5 Q