3v4l.org

run code in 300+ PHP versions simultaneously
<?php $wordsList = [ ['frog', 'Nock'], // All search strings ['sock', 'crock'], // All replacements ]; $message = str_replace( $wordsList[0], // All search strings $wordsList[1], // The replacements strings "frog frog Nock Nock" ); echo $message;

preferences:
28.22 ms | 404 KiB | 5 Q