PHP - Why use move_uploaded_file and not rename?
<p>In the manual I can see it says something about security reasons, but I didn't quite understand what is the problematic situation.</p>

<blockquote>
  <p>This function checks to ensure that the file designated by filename is
  a valid upload file (meaning that it was uploaded via PHP's HTTP POST
  upload mechanism). If the file is valid, it will be moved to the
  filename given by destination.</p>
  
  <p>This sort of check is especially important if there is any chance that
  anything done with uploaded files could reveal their contents to the
  user, or even to other users on the same system.</p>
</blockquote>

<p>So it makes sure it was uploaded via PHP, but if it will not check that, what could happen? what information could be revealed, and how?</p>

<p>Can someone explain this? An example will be great.</p>