Posted By

stz184 on 10/20/10


Tagged

file extension


Versions (?)

Get file extension


 / Published in: PHP
 

  1. function get_file_extension($file) {
  2. $e = explode('.', $file);
  3. return $e[count($e)-1];
  4. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: rikmeijer on October 20, 2010

return substr($file, strrpos($file, '.'));

Would roughly do the same

You need to login to post a comment.