$allowed = array('gif','png' ,'jpg'); $post_image1= $_FILES['upload1']['name']; $ext = pathinfo($post_image1, PATHINFO_EXTENSION); if(in_array($ext,$allowed) ) { //Do your stuff here } else { echo 'Image is not in jpg/png format'; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)