I am trying to upload something using PHP and set a limit on the total size that I allow to be uploaded. I want to limit my uploads to 2MB but for some reason whenever I try
if( $_FILES['file']['size'] && $_FILES['file']['size'] < (2<<20))
Try that.
<< is bitwise shift operator, decimal 2 is binary "10", then add 20 zeros.