Can anyone help me change this script to use preg_split (recommended substitute by php.net) instead of split which is not used anymore. This function gets the file extension of any uploaded file in the variable $filename.
function findExtension ($filename)
{
$filename = strtolower($filename) ;
$exts = split("[/\\.]", $filename) ;
$n = count($exts)-1;
$exts = $exts[$n];
return $exts;
}
Why don’t u use this function : http://www.php.net/manual/fr/function.finfo-file.php or this one : https://www.php.net/manual/fr/function.pathinfo.php
you can also use explode