Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Tommaso Vietina
Added: Aug 2, 2019 3:47 PM
Views: 8
Tags: no tags
  1. $ext     = explode('.', $allegato["filename"]); // Explode the string
  2. $ext_len = count($ext) - 1; // Count the array -1 (because count() starts from 1)
  3. $my_ext  = (string) $ext[$ext_len]; // Get the last entry of the array