Code: Select all
$fileName = basename($_FILES['uploadedFile']['name']);
$fileExt = eregi_replace('^.+\\.([^.]+)$', '\\1' , $fileName);Another question is how I can separate the pieces of info into two different strings example: test.jpg is passed in as $fileName then I do the pattern search and break it up into 2 different strings one called $fileExt which would contain 'jpg' (no period, no ') and $fileName which would equal 'test' (again no period and no')
Any help in solving these 2 problems would be greatly appreciated!