I am working on image compression in php.
<?php
if ($_POST) {
 echo $_FILES['file']['size'];
}
?>
<html>
    <head><title>Php code compress the image</title></head>
    <body>
  <form action="" name="myform" id="myform" method="post" enctype="multipart/form-data">
   <ul>
    <li>
     <label>Upload:</label>
                    <input type="file" name="file" id="file"/>
    </li>
    <li>
     <input type="submit" name="submit" id="submit" class="submit btn-success"/>
    </li>
   </ul>
  </form>
 </body>
</html>
This is working fine with the images less than 2MB.
if size>2MB then even its not showing in $_FILES after clicking on the submit button