title: Illegal offset type
body: <p>I am having trouble uploading a file through php.  I check the file type at the beginning of the process and I get an error.</p>
  
  <p>This is the error I am getting:  </p>
  
  <blockquote>
    <p>Warning: Illegal offset type in
    /balblabla/DBfunctions.inc.php on line
    183</p>
  </blockquote>
  
  <p>This is the printed out $_FILES var</p>
  
  <blockquote>
    <blockquote>
      <p>Array ( [Picture] => Array ( [name] =>
      JPG.jpg [type] => image/jpeg
      [tmp_name] => /tmp/phpHlrNY8 [error]
      => 0 [size] => 192221 ) ) </p>
    </blockquote>
  </blockquote>
  
  <p>Here is the segment of code I am using that is giving me issues:</p>
  
  <pre><code>function checkFile($file, $type)
  {
      if( in_array($_FILES[$file]['type'], $type) ){    //   &lt;---  LINE 183
          return true;
      }//if
      return false;
  } // end checkFile()
  </code></pre>
  
  <p>This is the line of code that calls the function</p>
  
  <blockquote>
    <p>if( checkFile( $_FILES['Picture'], array("image/jpeg") ) == true  ){<br>
    //do stuff<br>
    }// end if</p>
  </blockquote>
  
  <p>I have used this piece of code on dozens of websites on my own server so i am guessing that this is some different configuration option.  How can i modify my code so that it works on this different server?</p>