// Other variables $MAX_FILENAME_LENGTH = 260; $file_name = $_FILES[$upload_name][\'name\']; //echo \"testing-\".$file_name.\"\"; //$file_name = strtolower
Just as you can't index the array immediately, you can't call end on it either. Assign it to a variable first, then call end.
$basenameAndExtension = explode('.', $file_name); $ext = end($basenameAndExtension);