title: strpos() expects parameter 1 to be string, array given
body: <p>I'm getting this warning on my upload function and I just can't figure out why. I've looked at other questions of the same error but cannot get a solution.</p>
  
  <pre><code>function upload($name,$old,$dir=NULL,$autoid,$number)
  {
      global $def_dir;
      if(!$dir)$dir="../".$GLOBALS["logo"];
  
  
      if($_FILES[$name]['name']){
          if( is_file($dir.$old) ) unlink($dir.$old);
          $ext=substr($_FILES[$name]['name'],strpos($_FILES[$name]['name'],$name),strlen($_FILES[$name]['name']));
          $file=$autoid.'_'.$number.$ext;
  
          move_uploaded_file($_FILES[$name]['tmp_name'],$dir.$file);
  
      }else{
          $file=$old;
      }
  
      return($file);
  }
  </code></pre>
  
  <p>I've tried <code>var_dump($_FILES[$name]['name']</code>
  and the result was <code>string(24) "generic-project-icon.png"</code></p>
  
  <p>I've tried <code>print_r($_FILES[$name]['name'])</code> and the result was <code>generic-project-icon.png</code></p>
  
  <p>am I being blind or is there no array there? </p>
  
  <p>I just cannot figure out why this is happening.
  Any help is much appreciated. Thanks.</p>