title: validating file types from array
body: <pre><code>if ( isset( $_FILES['upload'] ) ) {
      $name_array = $_FILES['upload']['name']; 
      $size_array = $_FILES['upload']['size'];
      $type_array = $_FILES['upload']['type'];
      $ext = substr($upload, strrpos($upload, '.') + 1);
      $allowed = array('image/jpeg:jpg','image/pjpeg:jpg','image/gif:gif','image/png:png');
      $tmp_name_array = $_FILES['upload']['tmp_name'];
  
      if (!in_array($_FILES['uploaded']['type'], $allowed)){
  
      exit("unsupported");
      }
  
  
              if ( move_uploaded_file( $tmp_name_array[$i], "uploaded/" . $name_array[$i] ) ) {
                      echo "Image $name_array[$i] uploaded&lt;br&gt;";
              } else {
                      echo "Image #$i left blank&lt;br&gt;";
              }
      }
  </code></pre>
  
  <p>what exactly am I doing wrong? I could really do with some help. thanks. If it is not clear what I am trying to achieve is validation on 3 uploaded images from an array </p>