Deprecated: Function ereg_replace() is deprecated

Can someone please tell me how to fix this error in php?

$sBaseRoot0=ereg_replace($sBaseVirtual0,"",$sBase0); //output: "c:/inetpub/wwwroot"
if($sBase1!="")$sBaseRoot1=ereg_replace($sBaseVirtual1,"",$sBase1);
if($sBase2!="")$sBaseRoot2=ereg_replace($sBaseVirtual2,"",$sBase2);
if($sBase3!="")$sBaseRoot3=ereg_replace($sBaseVirtual3,"",$sBase3);

why not use str_replace to change ereg_replace it will do the same work ereg_replace will do

http://www.php.net/ereg_replace

The manual gives you the suggested alternative. Although in this case I’d follow prince55l’s suggestion.