Function ereg_replace() is deprecated

Function ereg_replace() is deprecated :

Example :

print $input.”<hr>”.ereg_replace(‘/&/’, ‘:::’, $input);

Replace

print $input.”<hr>”.preg_replace(‘/&/’, ‘:::’, $input);

Another  example :

$anwar = ereg_replace(‘[^A-Za-z0-9_]’, ”, $ anwar );

Replace to

$ anwar = preg_replace(‘/[^A-Za-z0-9_]/’, ”, $ anwar );