<?php
declare(strict_types=1);
$s = "the cat sat";
// replace every occurrence
echo str_replace("at", "og", $s), "\n";
// arrays do several replacements at once
echo str_replace(["cat", "sat"], ["dog", "ran"], $s), "\n";single and array replacements