Posted By

Envo on 05/02/11


Tagged

php file extension


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Some0ne
HalfWinter


Get file extension


 / Published in: PHP
 

URL: http://php.net/manual/en/function.pathinfo.php

  1. $filename = 'image.jpg';
  2.  
  3. $file = pathinfo($filename);
  4. echo $file['extension']; // output: jpg

Report this snippet  

You need to login to post a comment.