The preg_replace() function is a built-in function of PHP. It is used to perform a regular expression search and replace.
This function searches for pattern in subject parameter and replaces them with the replacement.
This function accepts five parameters, which are described below: