title: Isn't Using the basename function with $_FILES['userFile']['name'] Redundant?
body: <p>According to <a href="http://www.php.net/manual/en/features.file-upload.post-method.php" rel="nofollow noreferrer">the <em>POST method uploads</em> section</a> of <a href="http://www.php.net/manual/en/index.php" rel="nofollow noreferrer">the PHP Manual</a>, <code>$_FILES['userfile']['name']</code> is the original name of the file on the client machine. Example #2 in that section uses the <a href="http://php.net/manual/en/function.basename.php" rel="nofollow noreferrer"><code>basename</code></a> function with <code>$_FILES['userfile']['name']</code> like the following:</p>
  
  <pre><code>$uploaddir = '/var/www/uploads/';
  $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
  </code></pre>
  
  <p>I did some experiments on my local host (<em>Apache 2.2.14, PHP 5.3.1, Windows XP</em>) and found out that the following two lines are equivalent:</p>
  
  <pre><code>$_FILES['userFile']['name'];            // "file.txt"
  basename($_FILES['userFile']['name']);  // "file.txt"
  </code></pre>
  
  <p>That is, using the <code>basename</code> function with <code>$_FILES['userFile']['name']</code> seems rather redundant. Isn't it?</p>