Replaced ereg_replace by preg_replace