PHP Tutorial : Get file extension

With the next three lines of php code you will be able to get a file extension.

<?php
$file = “somefile.gif”;
$ext = end(explode(‘.’, $file));

print “Your file extension is $ext”;
?>

Read PHP Tutorial : Get file extension »