Replace Text Within a String

The str_replace() function replaces text in a string:

<?php
echo str_replace("freeCodeCamp", "Developer", "freeCodeCamp News"); // outputs Developer News
?>

php replace string