-1

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

Cup of Java
  • 1,769
  • 2
  • 21
  • 34

1 Answers1

1

Just changing

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

to:

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

Should work!

Johan Lindskogen
  • 1,246
  • 1
  • 8
  • 25
  • It should be $exts = preg_split("[\\.]", $filename);, as it is in your answer it doesn't recognize your regex. – dendini Mar 20 '14 at 13:01