x
 
<!DOCTYPE html>
<html>
<body>
<?php
$str = "Visit Microsoft!";
$pattern = "/microsoft/i";
echo preg_replace($pattern, "W3School", $str);
?>
</body>
</html>