Posted By

lolindirfaelivrin on 08/10/10


Tagged

php file extension


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

roli000
convergine


Get File Extension


 / Published in: PHP
 

  1. /**
  2. *
  3. * @Get File extension from file name
  4. *
  5. * @param string $filename the name of the file
  6. *
  7. * @return string
  8. *
  9. **/
  10. function getFileExtension($filename){
  11. return substr($filename, strrpos($filename, '.'));
  12. }

Report this snippet  

You need to login to post a comment.