Posted By

fawazcb on 04/24/12


Tagged

php files extension


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

fackz


Get file extension from name or complete path


 / Published in: PHP
 

Get file extension from it's name or complete path

  1. <?php
  2. function get_extension($file) {
  3. $extension = end(explode(".", $file));
  4. return $extension ? $extension : false;
  5. }
  6. ?>

Report this snippet  

You need to login to post a comment.