The preg_replace() function used for a regular expression search and replace.
Syntax
mixed preg_replace (mixed pattern, mixed replacement, mixed string [, int limit [, int &$count]] );
Example
$var="Year 2017";
$copyvar=preg_replace("[0-9]","2000",$var);
echo $copyvar;
Output
Year 2000
Copyright ©2022 coderraj.com. All Rights Reserved.