Get filename extension
Posted on July 15, 2008, Filled under PHP,
Bookmark it
This snippet can help you to get the extension of a filename:
<?php ... some code here ... // Filename $filename = 'public_html/root/internet.gif'; // Extension $ext = strrchr($filename, "."); echo $ext; // will return ".gif" ?>
Do you wish to receive the latest updates as soon as they are posted? Get our RSS Feed or Subscribe to the Newsletter!
- July 15, 2008
- article by Gabriel C.
- Leave a reply!
Sponsors
Related Posts
-
How to remove an extension from a filenameat September 4, 2008 with 1 comment
-
PHP: Get filename of the currently executing scriptat May 21, 2008
-
Create, Customize and Send Newsletters: MeeNewsat August 3, 2009 with 1 comment
-
How to make a PHP download script without disclosing the location of the filesat September 20, 2008 with 5 comments
