Which one of the following preg PHP function is used to do a find and replace on a string or an array?
A
preg_replace()
B
preg_find()
C
preg_find_replace()
D
preg_findre()
Correct Answer: preg_replace()
In preg_replace() function, after the replacement has occurred, the modified string will be returned and if no matches are found, the string will remain unchanged.