How can I convert
ereg_replace(".*\.(.*)$","\\1",$imgfile);
to
preg_replace... ?
?
I'm having trouble with it?
preg_replace("/.*\.(.*)$/", "\\1", "foo.jpg")
I don't know why PHP requires the /
delimiters. The only reason Perl, JS, etc. have them is that they allow regex literals, which PHP doesn't.