The preg_replace() function will replace all of the matches of the pattern in a string with another string.
<?php $str = "Visit Microsoft!"; $pattern = "/microsoft/i"; echo preg_replace($pattern, "codeapka", $str); // Outputs "Visit codeapka!" ?>
The preg_replace() function will replace all of the matches of the pattern in a string with another string.
<?php $str = "Visit Microsoft!"; $pattern = "/microsoft/i"; echo preg_replace($pattern, "codeapka", $str); // Outputs "Visit codeapka!" ?>