Not able to check file size while uploading multiple files in PHP


I'm trying to check file size limit for Multiple file upload.Each and every time i receive Sorry your file is too large upload maximum file size is 10 MB.   not able to figure out the mistake.

without providing the file limit the file upload is working fine. I have also made the necessary changes in the PHP.ini file like POST_MAX_SIZE and MAX_FILE_SIZE still the response is same.

foreach($_FILES['upload_slider']['tmp_name'] as $key => $tmp_name){   #file upload size - file size 10MB   $fileSize = $_FILES['upload_slider']['size'][$key];   if ($fileSize <= 10485760) #10 MB    {
$_SESSION['upload_warning'] = "Sorry