Friday, November 26, 2010

Get filename extension

Get filename extension...
<?php
... some code here ...
// Filename
$filename = 'public_html/root/internet.gif';
// Extension
$ext = strrchr($filename, ".");
echo $ext; // will return ".gif"
?>

No comments:

Post a Comment