Get a file extension from file name

Posted on

It’s sound…crazy but sometime it’s really useful. :). You can reuse it many times in your application.
<?php
function getfileextension($filename) {
return substr(strrchr($file
name,’.’),1);
}
?>

Leave a Reply

Your email address will not be published.