get the file extension of a filename in a string

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. function get_file_extension($file_name) {
  2. return substr(strrchr($file_name,'.'),1);
  3. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.