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


You need to login to view comments.