title: boolean in my function didn't work for determine file size
body: <p>I made the function for upload and I add boolean data type for determine the file extension and file size, I write the result  by javascript alert code, and then, that boolean just working for file extension validation, but not for file size validation.</p>
  
  <p>What should i do? Here's some code I made:</p>
  
  <pre><code>function upload() {
         $namaFile = $_FILES['FOTO']['name'];
         $ukuranFile = $_FILES['FOTO']['size'];
         $error = $_FILES['FOTO']['error'];
         $tmpName = $_FILES['FOTO']['tmp_name'];
  
         //cek apakah tidak ada gambar yang di upload
         if ($error === 4 ) {
            echo "&lt;script&gt;
                  alert('pilih gambar terlebih dahulu!');
                 &lt;/script&gt;";
           return false;
          }
  
          //cek apakah yang di upload gambar atau jenis file lain
          $ekstensiGambarValid = ['jpg', 'jpeg', 'png'];
          $ekstensiGambar = explode('.', $namaFile);
          $ekstensiGambar = strtolower(end($ekstensiGambar));
          if( !in_array($ekstensiGambar, $ekstensiGambarValid)) {
          echo "&lt;script&gt;
              alert('hanya diperbolahkan upload file berformat jpg, jpeg, dan 
                     png saja!');
               &lt;/script&gt;";
            return false;
            }
  
           //cek jika ukuran file terlalu besar
           if ( $ukuranFile &gt; 1000000 ) {
              echo "&lt;script&gt;
                 alert('Ukuran file terlalu besar!');
                   &lt;/script&gt;";
             return false;
            }
  }
  </code></pre>
  
  <p>I expect the output is "Ukuran file terlalu besar" //(&lt;--this indo lang )
  but the actual output is default notice I've been write on main file before.</p>