Question

Here is my code that I want to update from 5.1 to 5.3 in php

$filename=$_FILES['file']['name'];

function findexts ($filename) 
{ 
$filename = strtolower($filename) ; 
$exts = split("[/\\.]", $filename) ; 
$n = count($exts)-1; 
$exts = $exts[$n]; 
return $exts; 

But I am very confused on how to do it

Was it helpful?

Solution

Just changing

$exts = split("[/\\.]", $filename);

to:

$exts = preg_split("[/\\.]", $filename);

Should work!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top