<input name= "p_image[]" type="file" id="p_image[]">
i need that user upload atleast one image and if it doesn't it show error..
<input name= "p_image[]" type="file" id="p_image[]">
i need that user upload atleast one image and if it doesn't it show error..
You can check the count
of the array, and if it's equal to 0
, then throw an error:
<?php
if(isset($_POST['p_image'])) {
if(!(count($_POST['p_image']))) {
//throw error here...
}
} else {
//throw another error here...
}
?>