Posted By

IanLewis on 05/21/07


Tagged

filename extention


Versions (?)

Who likes this?

9 people have marked this snippet as a favorite

luman
vali29
hudge
benrasmusen
skywalker
juke
mrjthethird
nb109
mecha


Get a filename extension


 / Published in: PHP
 

Gets a filename's extention.

  1. //gets a filenames extension
  2. function filename_extension($filename) {//{{{
  3. $pos = strrpos($filename, '.');
  4. if($pos===false) {
  5. return false;
  6. } else {
  7. return substr($filename, $pos+1);
  8. }
  9. }//}}}

Report this snippet  

You need to login to post a comment.