Get the extension of a filename

preg_replace("/.*?./", '', 'photo.jpg');

source

Leave a Reply