I have a question, how to check if the size of a picture is between 1mb and 4mb?
I have done sth like this but it brings me an error:
<?php
if (($_FILES['pic']['size'][$k] > 1000000) && ($_FILES['pic']['size'][$k] < 4000000))
{ // do sth here }
?>
I have a question, how to check if the size of a picture is between 1mb and 4mb?
I have done sth like this but it brings me an error:
<?php
if (($_FILES['pic']['size'][$k] > 1000000) && ($_FILES['pic']['size'][$k] < 4000000))
{ // do sth here }
?>
$min_mb = 1;
$max_mb = 4;
if($_FILES['pic']['size'] > ($min_mb * 1000 * 1000) && $_FILES['pic']['size'] < ($max_mb * 1000 * 1000))
{
//This image falls between the min and max successfully
}