title: side effects of using ereg_replace and its replacement
body: <p>I'm new to php. I have the following code:</p>
  
  <pre><code>$this-&gt;image["format"] = ereg_replace(".*\.(.*)$", "\\1", $imgfile);
  $this-&gt;image["outputformat"] = ereg_replace(".*\.(.*)$", "\\1", $save);
  </code></pre>
  
  <p>which is working fine but I'm receiving an error Deprecated: Function ereg_replace().
  I want to ask if there are any side effects of using deprecated functions in php? and if there is some other replacement. I tried preg but it's not working either. Thanks in advance :)</p>