How can I replace a substring in a string in PHP? Example code: - Biz Tech

How can I replace a substring in a string in PHP? Example code:

Listen
$string = "The quick brown fox jumps over the lazy dog";

echo str_replace("fox", "cat", $string);