Get file extension from string


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

Given a string of a file name, return the extension


Copy this code and paste it in your HTML
  1. $extension=substr(strrchr($file,'.'),1);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.