File Validation

Here is a simple function to valid a image file. You can modify/add extensions and mime type according to your needs. function checkImageTypeArray($file) { $errorarray=array(); $allowExtension = array(“gif”, “jpeg”, “jpg”, “png”); $allowMime = array(“image/gif”, “image/jpesg”, “image/pjpeg”, “image/x-png”,”image/png”); $getFileExtension = pathinfo($file[‘name’],PATHINFO_EXTENSION);…